Closed Hert79 closed 4 weeks ago
Hi @Hert79, if you display the paths in the DlaViewer, you will see the invisible text you are refering to is outside the clipping path.
I'm pretty sure that explains why this text will not be rendered (even if the text is black) as only what's inside the clipping path should be painted.
PdfPig does not support clipping for letters at the moment (it does for paths), but this is something I might look into soon.
A note about clipping path: For the moment, there is no way to check that this particular clipping path is actually related to the invisible text (but because this document example is very simple, this is most certainly the case). In more complex documents, it might be difficult to link letters to their clipping path.
I think this is where the check for inside or outside of clipping path should be done for text (really not sure though): https://github.com/UglyToad/PdfPig/blob/3898f09a5f9447c68204d0e5fc238f19d082c028/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs#LL226C8-L230C18
As an fyi, this is where the path are clipped https://github.com/UglyToad/PdfPig/blob/3898f09a5f9447c68204d0e5fc238f19d082c028/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs#LL759C9-L759C32
Clipping letters now supported via #905
HiddenText.pdf There appears to be no text on this page, but PdfPig does return some TextBlocks and DocumentLayoutAnalyis confirms the text is within the page's cropbox:
however PdfPig returns the letters as having color RGB{1:1:1} which is black. There are no images on top of the text.
How can I detect that this text is in fact invisible? Tested this with the latest prerelease.