function SaveAsPdfR(const FileName: string): Boolean; overload;
function SaveAsPdfR(const FileName: string; const Options: TPdfRSaveOptions): Boolean; overload;
SaveAsPdfR realiza primero el SaveAs normal y después superpone una
actualización incremental sobre los bytes guardados que adjunta marcadores de formato de archivo
PDF/R-1. PDF/R-1 (ISO 23504-1:2020) es el subconjunto estricto de transporte de imágenes ráster de PDF
usado por el TWAIN Working Group para flujos de trabajo de documentos escaneados; lleva un búfer ráster
de tamaño fijo por página, admite solo imágenes bitonales / escala de grises / RGB y compresión
FlateDecode / CCITTFaxDecode / DCTDecode
El posprocesado inyecta cinco clases de bytes en el flujo guardado:
%PDF-raster-1.0 version-identification comment, written between the trailer dictionary and the startxref keyword (ISO 23504-1 §5). This is unique to PDF/R — the other PDF/x standards identify themselves through XMP and Info-dictionary entries instead.La salida permanece idéntica en bytes al resultado base de SaveAs hasta el
final del PDF original; solo se añade la actualización incremental (y el catálogo / Info de origen se
sustituyen por versiones recortadas mediante reescritura con el mismo número de objeto). Las dos
sobrecargas difieren solo en cómo se pasa la configuración: la forma de solo nombre de archivo usa
TPdfRSaveOptions.Default con autocompletado de los cuatro campos Info y DocumentId desde
FPDF_GetMetaText / FPDF_GetFileIdentifier
Returns True on success.
[0 0 w h], only FlateDecode / CCITTFaxDecode (bitonal) / DCTDecode (8-bit gray or RGB) filters are allowed, no object streams, every indirect reference must have generation number zero, and each page is essentially a single raster image. PDFium-generated documents that already match this pattern (e.g. scanner output passed through PDFium for repackaging) work well; arbitrary content-rich PDFs typically do not.TPdfRSaveOptions.StripCatalogOptionalEntries and StripInfoOptionalEntries default to True; set them False if you want the injector to preserve all source entries (the output then won't meet §6.3 / §6.4.3 but the version marker and XMP are still attached).%PDF-2.0 header and AES encryption. PDFium-generated PDFs use a 1.x header so encrypted output isn't a PDF/R-1 candidate without further re-saving.
// 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');