Heat the oven to 390°F. Roll each sheet to fit an 8 × 12-inch pan and prick with a fork.
Bake the sheets on parchment under an oven-safe tray or baking weights for 15–20 minutes. Uncover and bake 5 minutes more until deep golden. Cool and trim them to match.
Whisk the yolks, sugar, cornstarch and flour with a little cold milk. Heat the remaining milk and gradually whisk it into the yolks. Return everything to the saucepan and whisk over medium heat until thick and gently bubbling.
Stir in vanilla and butter. Press wrap on the surface and chill completely. Fold in the whipped cream if using.
Spread the custard between the pastry layers. Refrigerate for at least 3–4 hours or overnight. Dust with powdered sugar and slice with a serrated knife.