PDFsharp icon indicating copy to clipboard operation
PDFsharp copied to clipboard

Compatibility options

Open Technus opened this issue 7 months ago • 3 comments

Added couple compatibility options for writing/reading the PDF file:

Accessible as properties in: PdfReaderOptions and PdfDocumentOptions

        public bool EnableReferenceRenumbering { get; set; } = true;
        public bool EnableReferenceCompaction { get; set; } = true;
        public bool EnableImplicitTransparencyGroup { get; set; } = true;
        public bool EnableImplicitMetadata { get; set; } = true;
        public bool EnableWriterCommentInTrailer { get; set; } = true;
        public bool EnableLfLineEndings { get; set; } = true;
        public bool EnableOwnBinaryHeader { get; set; } = true;
        public bool EnableLineBreakInArrayObjects { get; set; } = true;
        public bool DisablePagesAndCatalogAtEnd { get; set; } = true;

Mainly to align the binary format of the file to match SAP/Acrobat more closely and fix printing issues on Ricoh printers.

Setting them to non default values enables the patch.

Technus avatar Jun 25 '25 12:06 Technus

Main culprit seems to be EnableLineBreakInArrayObjects, no other writer seem to include any whitespace after the [ sign. And after changing that printing started to work as expected.

Technus avatar Jun 25 '25 12:06 Technus

Hi! The upcoming version 6.2.1 writes the content of each object in one single line. This fixes your issue with left brackets. But what are the benefits of CRLF instead of LF? Or why writing Page objects and Catalog at the end of the PDF file?

StLange avatar Jul 23 '25 10:07 StLange

It s just the binary differences compared to the input file I found while opening and saving the file. Might be a non issue.

Technus avatar Aug 04 '25 05:08 Technus