Saving To PDF document size is increasing
Posted: Sat May 22, 2021 1:56 am
Hello, I'm running into a strange issue that I'm hoping there might be a quick answer for. In a released version of our product, which currently uses version 9.1.2.23 of the Imaging library we're seeing files increase in size by about 400kb per PdfFreeTextAnnotation that is being added when we save.
The save code is just doing ImageViewer.Images.SaveSync(destinationFile, pdfEncoder).
Interestingly your demo application does not appear to have this problem, but does seem to be using the same save as well as encoder settings. Do you have any idea why this might be? Looking at the resulting document in a text editor it looks like the issue is embedding fonts, is there a way to remove embedded fonts?
Specifically I think that entries like this (followed by a bunch of ASCII) are the issue, but I'm unsure where they're coming from.
Any help you can provide would be much appreciated!
The save code is just doing ImageViewer.Images.SaveSync(destinationFile, pdfEncoder).
Interestingly your demo application does not appear to have this problem, but does seem to be using the same save as well as encoder settings. Do you have any idea why this might be? Looking at the resulting document in a text editor it looks like the issue is embedding fonts, is there a way to remove embedded fonts?
Specifically I think that entries like this (followed by a bunch of ASCII) are the issue, but I'm unsure where they're coming from.
Code: Select all
<</Type/Font/Subtype/Type0/BaseFont/CourierNewPSMT/DescendantFonts[35 0 R]/Encoding/Identity-H/ToUnicode 36 0 R>>
endobj
35 0 obj
<</Type/Font/Subtype/CIDFontType2/BaseFont/CourierNewPSMT/FontDescriptor 33 0 R/CIDSystemInfo<</Registry(Adobe)/Ordering(Identity)/Supplement 0>>/CIDToGIDMap/Identity/W[0[600 0] 2 3761 600 3762[600]]>>
endobj
36 0 obj
<</Filter/FlateDecode/Length 8849>>