Package com.pspdfkit.document.processor
Class PageImage
-
- All Implemented Interfaces:
public class PageImage
Represents an image to be added to a PDF page.
-
-
Field Summary
Fields Modifier and Type Field Description public final PagePosition
position
public final RectF
positionRect
public int
rotation
public PageZOrder
zOrder
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
Modifier and Type Method Description 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. void
setRotation(@IntRange(from = "-270", to = 270) int rotation)
Sets rotation for the added image. PageZOrder
getZOrder()
Returns the z-order of the image when added toa page. void
setZOrder(@NonNull() PageZOrder zOrder)
Sets Z order of the image when added, foreground or background. void
setJpegQuality(@IntRange(from = 0, to = 100) int quality)
Sets quality for image if it has to be re-compressed to JPEG. String
toString()
-
-
Constructor Detail
-
PageImage
PageImage(Context context, Uri fileUri, PagePosition position)
Page image from an existing file.- Parameters:
context
- Context of the calling component.fileUri
- URI to file, may be a file URI or a content provider URI.position
- Alignment of the image on the page.
-
PageImage
PageImage(Bitmap bitmap, PagePosition position)
Page image from a bitmap.- Parameters:
bitmap
- Image bitmap.position
- Alignment of the image on the page.
-
PageImage
PageImage(Context context, Uri fileUri, RectF rect)
Page image from an existing file.- Parameters:
context
- Context of the calling component.fileUri
- URI to file, may be a file URI or a content provider URI.rect
- Positioning rect for the image on the page in PDF points.
-
-
Method Detail
-
getPosition
@NonNull() PagePosition getPosition()
Returns the page image position on the page.
- Returns:
Page position of the image.
-
getPositionRect
@Nullable() RectF getPositionRect()
Returns the position of the page image on the page.
- Returns:
The rectangle inside of which the image is positioned.
-
getRotation
@IntRange(from = "-270", to = 270) int getRotation()
Returns currently set rotation for this image.
- Returns:
rotation in degrees, valid values are 0, 180, 270 and their negative counterparts.
-
setRotation
void setRotation(@IntRange(from = "-270", to = 270) int rotation)
Sets rotation for the added image.
- Parameters:
rotation
- rotation in degrees, valid values are 0, 180, 270 and their negative counterparts.
-
getZOrder
@NonNull() PageZOrder getZOrder()
Returns the z-order of the image when added toa page.
- Returns:
Image's z-order.
-
setZOrder
void setZOrder(@NonNull() PageZOrder zOrder)
Sets Z order of the image when added, foreground or background.
- Parameters:
zOrder
- z-order of this image when added.
-
setJpegQuality
void setJpegQuality(@IntRange(from = 0, to = 100) 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.
-
-
-
-