-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF file size is huge, image is 759kb, and PDF file is 10MB #197
Comments
Use release mode? Images are uncompressed in debug mode. Image compression is on by default in |
Well it's 5.2 MB with |
I'm running into the same problem, running on 0.7.0 because thats the latest in cargo. Any chance you could publish 0.8? |
Still blocked on yeslogic/allsorts#110. In the meantime, ideally fork this repo temporarily or use: [dependencies]
printpdf = { git = "https://github.com/fschutt/printpdf", rev = "ebe45a6" } There are also still problems with layering and HTML rendering, but it should work overall. |
Also, I kind of want to add optional JPEG encoding, so that this problem doesn't come up again. PDF supports a built-in JPEG2000 decoding filter, but right now the image is embedded uncompressed, which is why the PDF is so large. |
I followed the official example and used the add_to_layer method to add a local image file to the page of a PDF file, but the final generated PDF file is particularly large! The size increased by 10 times. This is very strange. Do you have any ideas on how to solve this problem?
The original image file is 759 KB, and the final generated PDF file has become 10.3 MB.
here is my code https://github.com/hahazexia/img2pdf
The text was updated successfully, but these errors were encountered: