public class

PageImage

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.processor.PageImage

Class Overview

Represents an image to be added to a PDF page.

Summary

Public Constructors
PageImage(Context context, Uri fileUri, PagePosition position)
Page image from an existing file.
PageImage(Bitmap bitmap, PagePosition position)
Page image from a bitmap.
PageImage(Context context, Uri fileUri, RectF rect)
Page image from an existing file.
PageImage(Bitmap bitmap, RectF rect)
Page image from a bitmap.
Public Methods
PagePosition getPosition()
Returns the page image position on the page.
RectF getPositionRect()
Returns the position of the page image on the page.
int getRotation()
Returns currently set rotation for this image.
PageZOrder getZOrder()
Returns the z-order of the image when added toa page.
void setJpegQuality(int quality)
Sets quality for image if it has to be re-compressed to JPEG.
void setRotation(int rotation)
Sets rotation for the added image.
void setZOrder(PageZOrder zOrder)
Sets Z order of the image when added, foreground or background.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PageImage (Context context, Uri fileUri, PagePosition position)

Page image from an existing file. File may be from disk or from another content provider. Images not in JPEG format will be converted to JPEG according to quality settings.

Parameters
context Context of the calling component.
fileUri URI to file, may be a file URI or a content provider URI. Non-JPEG images will be converted before embedding.
position Alignment of the image on the page.

public PageImage (Bitmap bitmap, PagePosition position)

Page image from a bitmap. It will be converted to JPEG when embedding according to JPEG quality setting. Note that keeping a lot of bitmaps in memory may lead to OutOfMemoryError so passing a file URI is preferred.

Parameters
bitmap Image bitmap.
position Alignment of the image on the page.

public PageImage (Context context, Uri fileUri, RectF rect)

Page image from an existing file. File may be from disk or from another content provider. Images not in JPEG format will be converted to JPEG according to quality settings.

Parameters
context Context of the calling component.
fileUri URI to file, may be a file URI or a content provider URI. Non-JPEG images will be converted before embedding.
rect Positioning rect for the image on the page in PDF points. The image will be stretched to fill the rect. Remember that PDF coordinate system has point (0, 0) in bottom left!

public PageImage (Bitmap bitmap, RectF rect)

Page image from a bitmap. It will be converted to JPEG when embedding according to JPEG quality setting.

Parameters
bitmap Image bitmap.
rect Positioning rect for the image on the page in PDF points. The image will be stretched to fill the rect. Remember that PDF coordinate system has point (0, 0) in bottom left!

Public Methods

public PagePosition getPosition ()

Returns the page image position on the page.

Returns
  • Page position of the image.

public RectF getPositionRect ()

Returns the position of the page image on the page.

Returns
  • The rectangle inside of which the image is positioned.

public int getRotation ()

Returns currently set rotation for this image.

Returns
  • rotation in degrees, valid values are 0, 180, 270 and their negative counterparts.

public PageZOrder getZOrder ()

Returns the z-order of the image when added toa page.

Returns
  • Image's z-order.

public void setJpegQuality (int quality)

Sets quality for image if it has to be re-compressed to JPEG.

Parameters
quality Quality between 0 and 100, default is 98.

public void setRotation (int rotation)

Sets rotation for the added image.

Parameters
rotation rotation in degrees, valid values are 0, 180, 270 and their negative counterparts.

public void setZOrder (PageZOrder zOrder)

Sets Z order of the image when added, foreground or background.

Parameters
zOrder z-order of this image when added.

public String toString ()