pdf - itextsharp 5.4.4 - GetDrawingImage decodes this image the wong way - why? -
this pdf displayed on firefox in c#
program wrote using itextsharp
5.4.4, used getdrawingimage
method of pdfimageobject
, grabled image.
i used itextsharp in following way:
pdfreader reader = new pdfreader(filename); pdfreadercontentparser parser = new pdfreadercontentparser(reader); imagerenderlistener listener = new imagerenderlistener(); parser.processcontent(pagenumber, listener);
where imagerenderlistener
irenderlistener
, implements renderimage
method in following way:
public void renderimage(imagerenderinfo renderinfo) { pdfimageobject image = renderinfo.getimage(); pdfobject obj = image.get(pdfname.filter); pdfname filter = null; if (obj pdfname) { filter = (pdfname)obj; } else if (obj pdfarray) { foreach(var o in (pdfarray)obj) { if (o pdfname) { filter = o pdfname; break; } } } if (filter != null) { system.drawing.image drawingimage = image.getdrawingimage(); ... ... ... }
the drawing image stored in listener , drawn screen etc...
i tried understand this, filter /ccittfaxdecode
streamcontenttype
somehow png
, enlighten me on matter?
thanx in advance.
the reason problem explained in following video: ripping pdf files apart. if don't want sit through complete video, fast forward minute 24 , watch onto minute 27. note conclusion on minute 27: in general, there no images in pdf. (that's exaggerated, if understand 3 minutes of explanation, understand mark stephens means.)
if want details why ccittfaxdecode changed png, please read chapter 10 of my book.
Comments
Post a Comment