Class PdfDrawer
- java.lang.Object
-
- com.netgrif.application.engine.pdf.generator.service.PdfDrawer
-
- All Implemented Interfaces:
IPdfDrawer
@Service public class PdfDrawer extends java.lang.Object implements IPdfDrawer
A drawer service that is able to draw elements to a content stream
-
-
Constructor Summary
Constructors Constructor Description PdfDrawer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkBooleanValue(java.util.List<java.lang.String> values, java.lang.String text)
void
checkOpenPages()
void
closeContentStream()
void
closeTemplate()
void
drawBooleanBox(java.util.List<java.lang.String> values, java.lang.String text, int x, int y)
void
drawBooleanField(PdfField field)
void
drawDataGroupField(PdfField field)
void
drawEnumerationField(PdfField field)
void
drawI18nDividerField(PdfField field)
void
drawLine(int x, int y, int fieldPosY, int width, int lineCounter, float strokeWidth, java.awt.Color color)
void
drawMultiChoiceField(PdfField field)
void
drawPageNumber()
boolean
drawSelectionButton(java.util.List<java.lang.String> values, java.lang.String choice, int x, int y, FieldType fieldType)
void
drawStroke(int x, int y, int fieldPosY, int width, int lineCounter, float strokeWidth)
protected void
drawSvg(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject resourceObject, int x, int y)
void
drawTextField(PdfField field)
void
drawTitleField(PdfField field)
void
newPage()
void
setupDrawer(org.apache.pdfbox.pdmodel.PDDocument pdf, PdfResource pdfResource)
void
writeLabel(org.apache.pdfbox.pdmodel.font.PDType0Font font, int fontSize, int x, int y, java.lang.String text, java.awt.Color color)
void
writeString(org.apache.pdfbox.pdmodel.font.PDType0Font font, int fontSize, int x, int y, java.lang.String text, java.awt.Color color)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.netgrif.application.engine.pdf.generator.service.interfaces.IPdfDrawer
setTemplatePdf
-
-
-
-
Method Detail
-
setupDrawer
public void setupDrawer(org.apache.pdfbox.pdmodel.PDDocument pdf, PdfResource pdfResource)
- Specified by:
setupDrawer
in interfaceIPdfDrawer
-
closeContentStream
public void closeContentStream() throws java.io.IOException
- Specified by:
closeContentStream
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
closeTemplate
public void closeTemplate() throws java.io.IOException
- Specified by:
closeTemplate
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
newPage
public void newPage() throws java.io.IOException
- Specified by:
newPage
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
checkOpenPages
public void checkOpenPages() throws java.io.IOException
- Specified by:
checkOpenPages
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawPageNumber
public void drawPageNumber() throws java.io.IOException
- Specified by:
drawPageNumber
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawTitleField
public void drawTitleField(PdfField field) throws java.io.IOException
- Specified by:
drawTitleField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawDataGroupField
public void drawDataGroupField(PdfField field) throws java.io.IOException
- Specified by:
drawDataGroupField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawTextField
public void drawTextField(PdfField field) throws java.io.IOException
- Specified by:
drawTextField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawI18nDividerField
public void drawI18nDividerField(PdfField field) throws java.io.IOException
- Specified by:
drawI18nDividerField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawBooleanField
public void drawBooleanField(PdfField field) throws java.io.IOException
- Specified by:
drawBooleanField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawEnumerationField
public void drawEnumerationField(PdfField field) throws java.io.IOException
- Specified by:
drawEnumerationField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawMultiChoiceField
public void drawMultiChoiceField(PdfField field) throws java.io.IOException
- Specified by:
drawMultiChoiceField
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawBooleanBox
public void drawBooleanBox(java.util.List<java.lang.String> values, java.lang.String text, int x, int y) throws java.io.IOException
- Specified by:
drawBooleanBox
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawSelectionButton
public boolean drawSelectionButton(java.util.List<java.lang.String> values, java.lang.String choice, int x, int y, FieldType fieldType) throws java.io.IOException
- Specified by:
drawSelectionButton
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawStroke
public void drawStroke(int x, int y, int fieldPosY, int width, int lineCounter, float strokeWidth) throws java.io.IOException
- Specified by:
drawStroke
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
drawLine
public void drawLine(int x, int y, int fieldPosY, int width, int lineCounter, float strokeWidth, java.awt.Color color) throws java.io.IOException
- Specified by:
drawLine
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
writeString
public void writeString(org.apache.pdfbox.pdmodel.font.PDType0Font font, int fontSize, int x, int y, java.lang.String text, java.awt.Color color) throws java.io.IOException
- Specified by:
writeString
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
writeLabel
public void writeLabel(org.apache.pdfbox.pdmodel.font.PDType0Font font, int fontSize, int x, int y, java.lang.String text, java.awt.Color color) throws java.io.IOException
- Specified by:
writeLabel
in interfaceIPdfDrawer
- Throws:
java.io.IOException
-
checkBooleanValue
protected boolean checkBooleanValue(java.util.List<java.lang.String> values, java.lang.String text)
-
drawSvg
protected void drawSvg(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject resourceObject, int x, int y) throws java.io.IOException
- Throws:
java.io.IOException
-
-