Class ImageBase64
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.RenderElement
-
- com.cloudofficeprint.RenderElements.Images.Image
-
- com.cloudofficeprint.RenderElements.Images.ImageBase64
-
public class ImageBase64 extends Image
Represents an image to insert in a template with a base64-encoded string as source.
-
-
Constructor Summary
Constructors Constructor Description ImageBase64(java.lang.String name)
This object represent an image to insert in the template.ImageBase64(java.lang.String name, java.lang.String base64)
This object represent an image to insert in the template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setFileFromLocalFile(java.lang.String filePath)
Reads all bytes of the file, converts them to base64 and stores them in this.value.-
Methods inherited from class com.cloudofficeprint.RenderElements.Images.Image
getAltText, getHeight, getJSON, getMaxHeight, getMaxWidth, getRotation, getTargetUrl, getTemplateTags, getTransparency, getWidth, getWrapText, setAltText, setHeight, setMaxHeight, setMaxWidth, setRotation, setTargetUrl, setTransparency, setWidth, setWrapText
-
Methods inherited from class com.cloudofficeprint.RenderElements.RenderElement
getName, getValue, setName, setValue
-
-
-
-
Constructor Detail
-
ImageBase64
public ImageBase64(java.lang.String name)
This object represent an image to insert in the template. This constructor doesn't set the base64-string so setFromLocalFile should be called. The options of the image can be turned on via the setter functions.- Parameters:
name
- Name of this image for the tag.
-
ImageBase64
public ImageBase64(java.lang.String name, java.lang.String base64)
This object represent an image to insert in the template. The options of the image can be turned on via the setter functions. The source of this image is a base64-encoded string.- Parameters:
name
- Name of this image for the tag.base64
- Base64 string of the image.
-
-
Method Detail
-
setFileFromLocalFile
public void setFileFromLocalFile(java.lang.String filePath) throws java.io.IOException
Reads all bytes of the file, converts them to base64 and stores them in this.value.- Parameters:
filePath
- Path of the local file.- Throws:
java.io.IOException
- If file not found.
-
-