File size blows up for some files #2699
-
Hi I am modifying this suggested code My actual code is:
input file: link (767 KB) The problem is that the file size increases drastically. This doesn't happen with all files. Only some. Mostly official documents. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
your content stream can be compress to reduce size: the output: |
Beta Was this translation helpful? Give feedback.
-
That's great. But can you also tell me why the file size is increasing in the first place ? |
Beta Was this translation helpful? Give feedback.
-
Can you please elaborate on this part, i think i didn't fully understand: Thanks ! |
Beta Was this translation helpful? Give feedback.
-
Hi I finally got around to trying this solution. Here's the code
When i use this code, the file size increases to 2.8MB What's going on ? I also noticed that if I run the compression separately, after the for loop has finished, then the file size does indeed decrease. Please do let me know what's going on here. Thanks ! |
Beta Was this translation helpful? Give feedback.
-
I tried that also, but unfortunately, the file size still does not decrease. What results are you getting ? My steps:
|
Beta Was this translation helpful? Give feedback.
your content stream can be compress to reduce size:
https://pypdf.readthedocs.io/en/stable/user/file-size.html#lossless-compression
the output:
o1.pdf (<600 KB)