Skip to content
Discussion options

You must be logged in to vote

I have no immediate solution, but you can extract any stream data directly from a PDF via xref_stream_raw. This is as-is, without decompression. Then decompress this as desired/required and save it as an image in some desired format, potentially using Pillow.

Another idea is making a Pixmap from an image xref Pixmap(doc, xref). Then manipulate the pixmap's color and alpha channels in the desired way. Here, numpy can be a great helper.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by HinTak
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants