Skip to content

Convert pdf file to monochrome #2698

Answered by pubpub-zz
zain910128 asked this question in Q&A
Discussion options

You must be logged in to vote

There is no dedicated functions for that. for text and drawings, you should be able to look through contents looking for color operators (CS, cs, SC, SCN, sc, scn, G, g, RG, rg, K, k - see §4.5.7 in pdf 1.7 specification) and replace these lines with G or g operators with the adequate gray definition) but you will have to define your own translation rule.
for images, you can use the images[ ].replace() function to replace the image once converted to gray or black

Replies: 2 comments 4 replies

Comment options

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

You must be logged in to vote
4 replies
@pubpub-zz
Comment options

@zain910128
Comment options

@pubpub-zz
Comment options

@stefan6419846
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants