Abedellatif Hussein,

Abedellatif Hussein wrote
> Instead of parsing twice i will just loop through the objects inside the
> file and get the information before calling the parser like this:
> [...]
> Iam not sure if this is the appropriate way of doing it?

That way has some drawbacks:

* You iterate over all image XObjects present in the PDF without knowing
their use. Thus, in general you do not know whether the data you read are
relevant for your current page or not: The image might be located only on
some other page or even not be used at all.

* You miss inline images.

* You examine way more objects than necessary.

If on the other hand you can be sure that your PDFs are quite small, they
contain only one image each, and that respective image is encoded as an
XObject, that code may work for you.

Regards,   Michael

PS: The code is somewhat inelegant. E.g.: pdfStream and tg are the same
object (PdfStream is derived from PdfDictionary and pdfStream is already a
direct object), and for getting values from a PdfDictionary, resolving them
if indirect, and casting them to some distinguished PDF object class,
PdfDictionary offers convenience methods getAsXXX (getAsName, getAsNumber,
...).



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/How-to-skip-text-rendering-when-parsing-image-on-text-pdf-file-tp4655822p4657301.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to