galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

Is there a way to see if the background is transparency #217

Open peter-borgstedt opened 6 years ago

peter-borgstedt commented 6 years ago

It seems that it is possible to have transparent background on a PDF, as transparent fonts, images objects etc.

How do I check if a background is transparent? In Acrobat i read it is always white whether transparent or not, but in other readers it might not be so.

chunyenHuang commented 6 years ago

Well, it is possible, but I don't know if there is an easy way. You will need to find the graphic state object in the parent of the image stream dictionary. It could be something like

/Resources
  /Obj {ExtGState, ImageObject}
    /ExtGState
     /GS1 or GS2
      /ca 0.5 
    /ImageObject
     /Stream