PDFium Component Docs

SaveAsPdfR Metod

Denna API-post behåller identifierare, signaturer, kodblock och PDF-termer i ursprunglig form.
Komponent: TPdf  ·  Enhet: PDFium
Sparar det aktuella dokumentet som en PDF/R-1-kompatibel fil (ISO 23504-1:2020, delmängden för rasterbildsöverföring och lagring i PDF som används för skannade dokument)

Syntax

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

Beskrivning

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.

Anmärkningar

Exempel

// 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');

Se även

SaveAsPdfRToStream, ValidatePdfR, PdfRConformance, SaveAsPdfA, SaveAsPdfX