0

I am trying to extract images from a PDF using iTextsharp. The problem is when I extract images some masking is applied on top of it. But how can i get the same image as we can see it in the PDF file. Is there any solution in iTextsharp or any other solution for this.

Please help me..

Samo
  • 11
  • 2
  • 1
    [This answer](http://stackoverflow.com/a/24239462/1729265) shows you how to export the mask as a separate grayscale image (the value at each point representing the transparency / opaqueness) in case of iText/Java. It should be easily adapted to iTextSharp/C#. – mkl Sep 30 '15 at 12:24
  • Thank you very much for your input.. But how we can achieve same thing for MASK object? – Samo Oct 01 '15 at 06:39
  • *But how we can achieve same thing for MASK object* - I don't understand wjere you're heading. The answer I referenced does explicitly handle the `maskStream`. – mkl Oct 01 '15 at 07:37
  • I mean there is a clipped images are in my PDF file.. That i need to extract it and store it in a folder. So how can i do this? – Samo Oct 01 '15 at 08:24
  • *clipped image* - you mean clipped by a clipping path? That is a bit more difficult. A rudimentary support for paths has only recently (version 5.5.6) been introduced; if you use an `ExtRenderListener` instead of a `RenderListener`, you are also informed about path creation and path clipping operations and so can deduce the clip path active at the time of a `renderImage` call. But combining those information is up to you. As far as I have heard, though, changes in the path parsing API are afoot. – mkl Oct 01 '15 at 08:34

0 Answers0