procedure CreateDocument;
Creates a brand-new empty in-memory PDF document; requires Active to be False (calling CreateDocument while a document is already open raises EPdfError)
The fresh document contains no pages until you call AddPage / ImportPages
Wraps the matching PDFium API and surfaces it as a TPdf instance member, so you never have to juggle raw FPDF_DOCUMENT handles yourself
Pdf1.Active := False before calling CreateDocument; calling it on an active component raises EPdfErrorSaveAs to persist your changesPDFium (LoadLibrary / UnloadLibrary / GetRecommendedV8Flags) can be called without a TPdf instance
Pdf1.CreateDocument;
Pdf1.AddPage(1, 595, 842);