Package org.faceless.pdf2
Class PageExtractor.Image
- java.lang.Object
-
- org.faceless.pdf2.PageExtractor.Image
-
- Enclosing class:
- PageExtractor
public class PageExtractor.Image extends Object
A class representing a bitmap image which is extracted from thePageExtractor
. Each image has a location on the page and aRenderedImage
which actually contains the image. Images may be repeated over pages, or on one page, in which case the Image returned bygetImage()
will be the same object.- Since:
- 2.6.2
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getAngle()
Return the angle of rotation of this image on the page, in degrees clockwise from 12 o'clock.float[]
getCorners()
Return the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the image, specified clockwise from bottom left.float
getDPIX()
Get the horizontal resolution of the image in dots per inchfloat
getDPIY()
Get the vertical resolution of the image in dots per inchRenderedImage
getImage()
Return the imageReader
getMetaData()
Return any XMP MetaData which has been set on the image, ornull
if none exists.PDFPage
getPage()
Return thePDFPage
this image was found on - simply the page the parentPageExtractor
was created fromPDFImage
getPDFImage()
Return the PDFImageint
getUniqueId()
Return a unique ID for the underlying image.
-
-
-
Method Detail
-
getDPIX
public float getDPIX()
Get the horizontal resolution of the image in dots per inch
-
getDPIY
public float getDPIY()
Get the vertical resolution of the image in dots per inch
-
getPage
public PDFPage getPage()
Return thePDFPage
this image was found on - simply the page the parentPageExtractor
was created from- Since:
- 2.6.12
-
getImage
public RenderedImage getImage()
Return the image
-
getUniqueId
public int getUniqueId()
Return a unique ID for the underlying image. Multiple copies of the same image object in a PDF will have the same number, which is guaranteed to be unique.- Since:
- 2.11.6
-
getMetaData
public Reader getMetaData() throws IOException
Return any XMP MetaData which has been set on the image, or
null
if none exists.Since 2.24.3, the returned type is guaranteed to be a
StringReader
, and the metadata can be retrieved as a String by simply callingObject.toString()
on the return value.- Throws:
IOException
- Since:
- 2.11.6
- See Also:
PDF.getMetaData()
,PDFImage.setMetaData(java.lang.String)
,PDFImage.getMetaData()
-
getCorners
public float[] getCorners()
Return the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the image, specified clockwise from bottom left. The image baseline runs from (x1,y1) to (x4,y4).
-
getAngle
public float getAngle()
Return the angle of rotation of this image on the page, in degrees clockwise from 12 o'clock. Most images are not rotated and so will return 0.- Returns:
- the angle of the image
-
getPDFImage
public PDFImage getPDFImage()
Return the PDFImage- Since:
- 2.26.1
-
-