You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added compression to all content streams (not very fluent in go, changes have been based on PdfDictionaryObj.build; "works for me")
Should never create an invalid PDF (/FlateDecode Filter will be applied before interpreting content). Size of compressed content stream could be bigger than uncompressed stream for very small streams, or for streams with high-entropy content. But compression will work in most cases.
Text-rich documents should profit most, as PDF Unicode-Encoding (hex-encoded UCS16) is rather verbose and should compressed comparatively well.
Maybe this should be made into an document-level option, so that compression can be turned off if needed?
compressLevel can be set with .SetCompressLevel(level int) after .init() has completed (sets level to zlib.DefaultCompression).
Possible levels like in "compress/zlib", .SetCompressLevel(0) will create PDF with uncompressed streams, same as .SetNoCompression() (comfort method...)
Usage:
pdf := gopdf.GoPdf{} pdf.Start(...) // compressLevel is now zlib.DefaultCompression pdf.SetCompressLevel(0) // or pdf.SetNoCompression() => uncompressed
Kind of a feature request :)
Added compression to all content streams (not very fluent in go, changes have been based on PdfDictionaryObj.build; "works for me")
Should never create an invalid PDF (/FlateDecode Filter will be applied before interpreting content). Size of compressed content stream could be bigger than uncompressed stream for very small streams, or for streams with high-entropy content. But compression will work in most cases.
Text-rich documents should profit most, as PDF Unicode-Encoding (hex-encoded UCS16) is rather verbose and should compressed comparatively well.
Maybe this should be made into an document-level option, so that compression can be turned off if needed?
Pull Request: #59
Thank you!
The text was updated successfully, but these errors were encountered: