Class PageImage

  • All Implemented Interfaces:

    
    public class PageImage
    
                        

    Represents an image to be added to a PDF page.

    • 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.
      • PageImage

        PageImage(Bitmap bitmap, RectF rect)
        Page image from a bitmap.
        Parameters:
        bitmap - Image bitmap.
        rect - Positioning rect for the image on the page in PDF points.
    • Method Detail

      • 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.
      • 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.