Heat the oven to 220°C (200° fan) 425°F gas 7. Line 2 baking trays with non-stick baking paper.. Line the base and sides of a 23cm|9" square baking tin with non-stick baking paper.
Divide the pastry in half. Roll out each piece to a 25cm|10" square and put on the baking trays. Prick all over with a fork and bake for 8-10 minutes until golden. Trim each sheet to a 23cm|9" square. Put 1 half top side down in the baking tin.
Put the sugar, cornflour and custard powder into a pan. Gradually whisk in the cream until blended. Bring to a boil, stirring constantly and cook for 1-2 minutes, until thickened. Add the butter and vanilla and stir until smooth. Remove from the heat and whisk in the egg yolks until blended.
Spread the custard over the pastry in the tin. Cover with the remaining pastry square, top side up and press down lightly. Leave to cool completely.
Sift a thick layer of icing sugar over the top and cut into squares with a sharp serrated knife.