Abedellatif Hussein,

Abedellatif Hussein wrote
> in the attached file the actual image size is 1890X3070, but the values
> retrieved from pdfreader is 453.6X736.8 which represents the scaled
> dimensions.

Unfortunately you have not told us how you extracted those data. Doing it
the most natural way (you are using the parser package anyhow, so the
natural way is to use the parser package here, too), I get 1890x3070:

    class ImageDataExtractor implements RenderListener
    {
        public void renderImage(ImageRenderInfo renderInfo)
        {
            StringBuilder builder = new StringBuilder();
            try {
                PdfImageObject image = renderInfo.getImage();
                PdfDictionary dictionary = image.getDictionary();
                builder.append("Size:
").append(dictionary.getAsNumber(PdfName.WIDTH)).append('x').append(dictionary.getAsNumber(PdfName.HEIGHT));
            } catch (IOException e) {
                e.printStackTrace();
            }
            System.out.printf("Extracted image data: %s%n%n",
builder.toString());
        }
        [...]
    }

This RenderListener outputs "Extracted image data: Size: 1890x3070" when
used on your PDF. Other data also are available from the PdfImageObject
insteance.

Abedellatif Hussein wrote
> Is there a way to find the image dpi value from the pdf before calling the
> pdfcontent parser

As shown above you can easily get image data /during/ parsing. If you
necessarily need the image information first, parse twice, once to extract
image information, once to extract text information and process them in the
context with the now known image information.

Regards,   Michael



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

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
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