TTMSFNCPDFLib - set PDF page size

When is the right moment to set the document page size?

PDFLib:= TTMSFNCPDFLib.Create();
PDFLib.BeginDocument();

PDFLib.NewPage();
PDFLib.PageSize:= psA4;

My laser printer is still complaining about the document page size = Letter, which is the default page size.

before NewPage, eg

var
  p: TTMSFNCPDFLib;
begin
  p := TTMSFNCPDFLib.Create;
  p.EmbedFonts := False;
  p.BeginDocument('test_size.pdf');
  p.Header := '';
  p.HeaderSize := 0;
  p.Footer := '';
  p.FooterSize := 0;
  p.PageSize := psA4;
  p.PageOrientation := poPortrait;
  p.NewPage;
  p.Graphics.Font.Name := 'Arial';
  p.Graphics.Font.Color := gcBlack;
  p.Graphics.Font.Size := 10;
  p.Graphics.DrawText('A4 portrait', PointF(100, 50));
  p.PageSize := psA4;
  p.PageOrientation := poLandscape;
  p.NewPage;
  p.Graphics.DrawText('A4 portrait', PointF(100, 100));
  p.PageSize := psCustom;
  p.PageHeight := 300;
  p.PageWidth := 300;
  p.NewPage;                     
  p.Graphics.DrawText('Custom', PointF(50, 50));
  p.EndDocument(True);
  p.Free;
end;                         

Thank you Pawel,

I tried both, before and after NewPage(), but at first it seems to make to difference until I figured out that the Chrome Browser was causing the wrong page size when sending the pdf document to the printer.

Now I'm trying to figure out, why the printed elements (text, lines & rectangles), when open the document in the PDF reader, are excactly there where they should be, but not on the printed document...

30 minutes later....

I got it, the printer where scaling the print to 96%...