pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: How can i get the image document size?
Date Fri, 27 Mar 2015 15:35:13 GMT
Divide the px values by the dpi which you rendered the page at (the default is 72).

inches = px / dpi

Alternatively call PDPage.findCropBox() and divide the result by 72.

-- John

> On 27 Mar 2015, at 00:30, BUSSINGER Fabien <fabien.bussinger@docapost.fr> wrote:
> 
> Hi,
>  
> I’m unable to find the way to capture the size of an image in a PDF with v1.8.8 of
PDFBox.
> I know how to get the real size like 3000px*2000px but I would like to know the way to
capture the document relative size. Like 3in*2in for example.
> I tried with extending the PDFStreamEngine classe but the value returned didn’t seem
to be good.
>  
> Thanks for the responses 
>  
>  
> Fabien BUSSINGER
> Projets « Elections »
> BU DIGITAL PLATFORM
> DOCAPOST Grands-Comptes /ETI
>  
> 
>  
> Les Vaisseaux – Bât C – Rue du Vallon – BP 49 – 06901 Sophia-Antipolis Cedex
> Tél. : +33 (0)4 93 95 76 42 – fabien.bussinger@docapost.fr
> www.docapost.com
>  
> 
>  
> DOCAPOST est une filiale du Groupe La Poste
> Adoptez l'éco-attitude : n'imprimez que si cela vous semble vraiment nécessaire.
>  

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message