Class PDFImage
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.PDF.PDFInsertObject
-
- com.cloudofficeprint.RenderElements.PDF.PDFImage
-
public class PDFImage extends PDFInsertObject
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getHeight()
java.lang.String
getIdentifier()
java.lang.String
getImage()
com.google.gson.JsonObject
getJson()
java.lang.Integer
getMaxWidth()
java.lang.Integer
getRotation()
java.lang.Integer
getWidth()
void
setHeight(java.lang.Integer height)
void
setImage(java.lang.String image)
void
setImageFromLocalFile(java.lang.String filePath)
Sets the image to the image on the filepath.void
setMaxWidth(java.lang.Integer maxWidth)
void
setRotation(java.lang.Integer rotation)
void
setWidth(java.lang.Integer width)
-
Methods inherited from class com.cloudofficeprint.RenderElements.PDF.PDFInsertObject
getPageNumber, getX, getY, setPageNumber, setX, setY
-
-
-
-
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 classPDFInsertObject
- 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 classPDFInsertObject
- Returns:
- Identifier for the JSON.
-
-