API reference

Import & Output APIs

75 functions. Every declaration on the detail pages is extracted from the shipped bindings.

Core

pdfBalanceContentStream Repair an uneven q/Q nesting in the current page's content.
pdfClearFileList Empty a named string list previously filled with
pdfCloseFile Serialize and finish the document.
pdfCloseFileEx pdfCloseFile plus encryption in one call.
pdfCloseImportFile Close the current import source.
pdfCloseImportFileEx Identical to [pdfCloseImportFile](#api-pdfcloseimportfile); the Handle argument is accepted for ABI compatibility and ignored (single import slot).
pdfCloseTag Close the most-recently-opened, not-yet-closed structure
pdfCombineContentStreams Always succeeds on a valid instance — the page already has exactly one stream, which is the post-condition this call promises.
pdfContentStreamCount Number of content streams of the current page.
pdfContentStreamSafe Test whether the current page's q/Q operators are balanced.
pdfDebugPDFFile Quick liveness/diagnostic probe.
pdfDeleteEmbeddedFile Remove an attachment so it is not written to the output.
pdfEncapsulateContentStream Wrap the current page's entire content in q … Q so its
pdfFindEmbeddedFile Look up an attachment by its exact stored file name.
pdfFlushPageContent Flush the open page's content to the output (streaming ABI).
pdfFlushPages Flush finished pages to the output file (streaming ABI).
pdfFlushPagesEx Same behavior as [pdfFlushPages](#api-pdfflushpages); Flags and LastPage are ignored.
pdfHaveOpenDoc Test whether an output document is open on the instance
pdfHaveOpenPage Test whether a page is currently open for content
pdfInsertBMPFromBuffer Place a BMP image held in memory onto the open page.
pdfMoveContentStream Compatibility shim: succeeds only for the trivial move (FromPosition = ToPosition ≥ 0).
pdfNewContentStream Start a new content stream on the current page (ABI compatibility).
pdfOpenOutputFile Same contract as [pdfCreateNewPDF](#api-pdfcreatenewpdf) (both route to OpenOutputFile); provided for ABI compatibility.
pdfOpenTag Open a new structure element (push it onto a real
pdfOpenTagBBox The same open-tag primitive as pdfOpenTag, additionally
pdfOpenTagEx Open a new structure element (push it onto a real
pdfRemoveSharedContentStreams Always succeeds on a valid instance — authored pages never share content streams in this engine, so there is nothing to unshare.
pdfReOpenImportFile Re-open the last file import source from its remembered path.
pdfReplaceICCProfile Replace the profile bytes of an existing ICCBased color
pdfReplaceICCProfileEx Buffer variant of [pdfReplaceICCProfile](#api-pdfreplaceiccprofile); the profile bytes are copied out of Buffer.
pdfRetrieveCustomDataToFile Write the blob stored under (Location, Key) to FileName (created or overwritten).
pdfSaveGraphicState Emit a q operator (save graphics state) into the current
pdfSaveStyle Save the current text/graphics style under a name.
pdfSelectContentStream Compatibility shim: succeeds only for NewIndex = 0 (the one physical stream).
pdfStoreCustomDataFromFile Store a file's raw bytes as a private blob under
pdfUseUnsafeContentStreams Set the content-safety level (ABI compatibility).

Getters

pdfGetBuffer Fetch the finished document bytes after an in-memory close.
pdfGetCairoFileName Path of an external Cairo DLL.
pdfGetDocumentFileName Returns the output path passed to pdfCreateNewPDF…/pdfOpenOutputFile (empty for in-memory output), as an instance-owned string; NULL on an invalid handle.
pdfGetDocumentFileSize Size in bytes of the output file on disk.
pdfGetEmbeddedFile Read an attachment's bytes and obtain the node/filespec object
pdfGetEmbeddedFileCount Returns the number of attachment slots on the instance (including tombstoned/deleted slots — see [pdfDeleteEmbeddedFile](#api-pdfdeleteembeddedfile)); 0 on an invalid handle.
pdfGetEmbeddedFileNode Read an attachment's name and size through the node handle
pdfGetFileSpec Read an attachment's filespec (file name + /AFRelationship)
pdfGetImportDataAction Read back an ImportData action created earlier (action
pdfGetImportFlags Returns the current flag mask (default $0FFFFFFE); 0 on an invalid handle.
pdfGetImportFlags2 Returns the stored secondary mask (default 0); 0 on an invalid handle.
pdfGetOpenActionDestination If the document's OpenAction is a GoTo action, return its
pdfGetOpenActionJavaScript If the document's OpenAction is a JavaScript action, return
pdfGetPDFiumFileName Same pattern for an external PDFium DLL — stored and read back, never loaded.
pdfGetRelFileNode Read the related-file (associated file) node of an attachment
pdfGetUseGlobalImpFiles Global-import-file sharing flag (default FALSE).
pdfGetXFAStream Read one XFA packet (name + bytes) by 0-based index.
pdfGetXFAStreamCount Number of XFA packets on the instance; 0 on an invalid handle.

Import

pdfImportCatalogObjects Copy viewer-level catalog settings from the source.
pdfImportDocInfo Copy the source's document-info keys (Author, Title, Subject,
pdfImportOCProperties Recreate the source's optional-content groups (layers) in the
pdfImportPage Import one source page (1-based PageNum).
pdfImportPageEx Same operation as [pdfImportPage](#api-pdfimportpage); the scale factors are accepted for ABI compatibility and ignored, because in this engine scaling happens at placement time (pdfPlaceTemplateEx width/height arguments).
pdfImportPDFFile Import every page of the open import source in one call.
pdfOpenImportBuffer Open a PDF held in a memory buffer as the import source.
pdfOpenImportFile Open an existing PDF file as the instance's import source.

Object Creation

pdfCreateXFAStream Add an XFA packet (e.g. template, datasets, config) to

Setters

pdfSetCairoFileName Path of an external Cairo DLL.
pdfSetColDefFile Designate an embedded file (1-based attachment handle, see
pdfSetEmbeddedFileStrProperty Change a string property of an existing attachment.
pdfSetGDIPlusFileName Stores an alternative GDI+ DLL path.
pdfSetImportFlags Set the flag mask consulted by subsequent page imports.
pdfSetImportFlags2 Set the secondary flag mask (if2MergeLayers, if2Normalize,
pdfSetPDFiumFileName Same pattern for an external PDFium DLL — stored and read back, never loaded.
pdfSetUseGlobalImpFiles Global-import-file sharing flag (default FALSE).
pdfSetUseObjectStreams Emit the document with PDF 1.5 object streams and a
pdfSetUseSwapFile Enable disk swapping of finished page content (streaming ABI).
pdfSetUseSwapFileEx Same as [pdfSetUseSwapFile](#api-pdfsetuseswapfile); SwapDir is also ignored.
pdfSetXFAStream Replace the bytes of packet Index (0-based); the packet's name is kept.