PDFiumVCL Docs

SaveAsPdfR method

Deze API-entry behoudt identifiers, signatures, codeblokken en PDF-termen in hun oorspronkelijke vorm.
Component: TPdf  ·  Unit: PDFium
Saves the current document as a PDF/R-1 conformant file (ISO 23504-1:2020, the raster image transport and storage subset of PDF used for scanned documents).

Syntax

function SaveAsPdfR(const FileName: string): Boolean; overload;
function SaveAsPdfR(const FileName: string; const Options: TPdfRSaveOptions): Boolean; overload;

Description

SaveAsPdfR performs the regular SaveAs first, then layers an incremental update on top of the saved bytes that attaches PDF/R-1 file-format markers. PDF/R-1 (ISO 23504-1:2020) is the strict raster-image transport subset of PDF used by the TWAIN Working Group for scanned document workflows; it carries a fixed-size raster buffer per page, supports bitonal / grayscale / RGB images and FlateDecode / CCITTFaxDecode / DCTDecode compression only.

The post-processing injects five classes of bytes into the saved stream:

The output stays byte-identical to the base SaveAs result up to the end of the original PDF; only the incremental update is appended (and the source catalog / Info are replaced with stripped versions via same-object-number rewriting). The two overloads differ only in how the configuration is passed in: the file-name- only form uses TPdfRSaveOptions.Default with auto-population of the four Info fields and DocumentId from FPDF_GetMetaText / FPDF_GetFileIdentifier.

Returns True on success.

Remarks

Example

// Simple PDF/R-1 output; only meaningful when the source PDF is
// already a raster scan (one image per page, allowed filters only).
if Pdf1.SaveAsPdfR('C:\Scan.pdfr.pdf') then
  ShowMessage('Saved with PDF/R-1 markers');

// Validate to see whether structural rules are also satisfied
Pdf1.FileName := 'C:\Scan.pdfr.pdf';
Pdf1.Active := True;
if Pdf1.ValidatePdfR.IsCompliant then
  ShowMessage('PDF/R-1 conformant');

See Also

SaveAsPdfRToStream, ValidatePdfR, PdfRConformance, SaveAsPdfA, SaveAsPdfX