Comments (1)
pikepdf enables all of the safe, lossless compression options. You may need to save with recompress_flate=True
or else compression of existing compressed streams is not attempted (although, savings may be minimal). To achieve anything better and truly aggressive you need to do something that involves lossy/destructive operations that involve reinterpreting the PDF or studying its contents to see what elements can be removed.
Your first file is ~10 MB, almost all of which is due to the background on pages 1, 7, and 19.
qpdf
has a command line utility to JPEG-compress images in the PDF. (There's a way to access this through pikepdf.Job as well, although documentation is admittedly sparse on it, so qpdf is easier to use at this point.) That would work, and given the type of images, JPEG should be fine.
from pikepdf.
Related Issues (20)
- Instalation errors
- How to replace the value of an Object mapped to a variable HOT 1
- pikepdf, libjpeg, l HOT 1
- 8.11.0: pytest requires `conftest` HOT 5
- Add 2 overlaid images to page with transparency mask HOT 2
- Add type checking for setting XMP metadata HOT 1
- RDF/XMP generated by pikepdf is incorrect?
- Re-enable 32-bit wheels on Windows HOT 2
- While emplacing a pdf, it changes underlying page metadata incorrectly HOT 1
- The pdf doc has been linearized, but the property "fast web view" still is “no" HOT 1
- A PDF with dodgy (yet apparently valid per qpdf --check) structure is causing a crash HOT 1
- generic_type: type "ObjectStreamMode" is already registered! HOT 1
- `docinfo_from_xmp()` fails on reduced precision dates (`YYYY` / `YYYY-MM`) HOT 1
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 5: invalid continuation byte HOT 3
- [Feature] QPDFFormFieldObjectHelper setFormFieldName HOT 4
- pytest error: `-n` unknown HOT 2
- Specific Image with CCITT group 4 cannot be detected and treated HOT 2
- Missing sdist for 9.0.0 HOT 3
- pikepdf 9.0 fails to build on macOS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pikepdf.