How do I invert the colors of a PDF when displaying it?

54 views
Skip to first unread message

Aaron

unread,
Aug 21, 2014, 5:15:19 PM8/21/14
to pdfne...@googlegroups.com
Q:

I want to display PDFs in "night mode", where colors are all inverted --- black is white, white is black, etc.  Is there an easy way to do so with PDFNet?

------------

A:

There are several ways you could invert all colors of a page. 

Probably the easiest is just to add a white rectangle with a blend mode of Difference, which will cause all colours to display their inverse.  (I've attached an example PDF with just such an annotation.)  The PDFNet Android SDK makes it easy to add new custom annotations, so it would be possible to add a button to invert the colours of the page by adding a page-sized rectangle.

That said, there are many other methods for inverting colours if this one is problematic, such as directly editing the colours of each PDF element (http://www.pdftron.com/pdfnet/samplecode.html#ElementEdit).


inversion_annotation.pdf

Aaron

unread,
Jan 6, 2016, 7:35:54 PM1/6/16
to PDFTron PDFNet SDK
In PDFNet versions 6.3 or above, you can also use the PDFViewCtrl.SetColorPostProcessMode method to invert colors (for night mode).


 
Reply all
Reply to author
Forward
0 new messages