Class PDFImage

    • Constructor Summary

      Constructors 
      Constructor Description
      PDFImage​(java.lang.Integer x, java.lang.Integer y, java.lang.Integer pageNumber)
      Represents an image to insert in a PDF.
      PDFImage​(java.lang.Integer x, java.lang.Integer y, java.lang.Integer pageNumber, java.lang.String image)
      Represents an image to insert in a PDF.
    • Constructor Detail

      • PDFImage

        public PDFImage​(java.lang.Integer x,
                        java.lang.Integer y,
                        java.lang.Integer pageNumber,
                        java.lang.String image)
        Represents an image to insert in a PDF. The image options can be set with the setter functions.
        Parameters:
        x - X-coordinate of the position of the text in the template starting from bottom left.
        y - Y-coordinate of the position of the text in the template starting from bottom left.
        pageNumber - Page number of the page where the text should be inserted. -1 if the text should be displayed on all pages.
        image - Image base64 or URL.
      • PDFImage

        public PDFImage​(java.lang.Integer x,
                        java.lang.Integer y,
                        java.lang.Integer pageNumber)
        Represents an image to insert in a PDF. The image options can be set with the setter functions. In this constructor the image is not set. It should be set with setImageFromLocalFile.
        Parameters:
        x - X-coordinate of the position of the text in the template starting from bottom left.
        y - Y-coordinate of the position of the text in the template starting from bottom left.
        pageNumber - Page number of the page where the text should be inserted. -1 if the text should be displayed on all pages.
    • Method Detail

      • getImage

        public java.lang.String getImage()
        Returns:
        Image base64-encoded or URL.
      • setImage

        public void setImage​(java.lang.String image)
        Parameters:
        image - Image base64-encoded or URL.
      • getRotation

        public java.lang.Integer getRotation()
        Returns:
        Rotation in degrees.
      • setRotation

        public void setRotation​(java.lang.Integer rotation)
        Parameters:
        rotation - Rotation in degrees.
      • getWidth

        public java.lang.Integer getWidth()
        Returns:
        Image width in px.
      • setWidth

        public void setWidth​(java.lang.Integer width)
        Parameters:
        width - Image width in px.
      • getHeight

        public java.lang.Integer getHeight()
        Returns:
        Image height in px.
      • setHeight

        public void setHeight​(java.lang.Integer height)
        Parameters:
        height - Image height in px.
      • getMaxWidth

        public java.lang.Integer getMaxWidth()
        Returns:
        Max width for proportionally scaling.
      • setMaxWidth

        public void setMaxWidth​(java.lang.Integer maxWidth)
        Parameters:
        maxWidth - Max width for proportionally scaling.
      • getJson

        public com.google.gson.JsonObject getJson()
        Specified by:
        getJson in class PDFInsertObject
        Returns:
        JSONObject with the tags for this element for the Cloud Office Print server.
      • setImageFromLocalFile

        public void setImageFromLocalFile​(java.lang.String filePath)
                                   throws java.lang.Exception
        Sets the image to the image on the filepath.
        Parameters:
        filePath - Path of the local file.
        Throws:
        java.io.IOException - If file not found.
        java.lang.Exception
      • getIdentifier

        public java.lang.String getIdentifier()
        Specified by:
        getIdentifier in class PDFInsertObject
        Returns:
        Identifier for the JSON.