Package com.simplicite.util.tools
Class PDFTool
- java.lang.Object
-
- com.simplicite.util.tools.PDFTool
-
public class PDFTool extends java.lang.Object
PDF toolbox
This class only provides static variables and methods
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PDFTool.PDFEvent
PDF events, manage specific header and footerstatic interface
PDFTool.PDFInterface
PDF interface
-
Field Summary
Fields Modifier and Type Field Description static com.lowagie.text.Font
BOLD
static com.lowagie.text.pdf.PdfPCell
CELL_BLACK
static com.lowagie.text.pdf.PdfPCell
CELL_GRAY
static com.lowagie.text.pdf.PdfPCell
CELL_WHITE
static com.lowagie.text.Font
CODE
static com.lowagie.text.Paragraph
EMPTY
static java.lang.String
EURO
static com.lowagie.text.Font
HEADER
static java.awt.Color
IMAGE_COLOR
static float
IMAGE_SCALE
static com.lowagie.text.Font
MEDIUM
static com.lowagie.text.Font
MONO
static com.lowagie.text.Font
NORMAL
static com.lowagie.text.Font
SCRIPT
Deprecated, for removal: This API element is subject to removal in a future version.static com.lowagie.text.Font
SMALL
static com.lowagie.text.Font
TINY
static com.lowagie.text.Font
TITLE0
static com.lowagie.text.Font
TITLE1
static com.lowagie.text.Font
TITLE2
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static com.lowagie.text.Chapter
addChapter(com.lowagie.text.Document d, java.lang.String title, PDFTool.PDFEvent event, boolean isOpen)
static com.lowagie.text.Paragraph
addHTMLParagraph(java.lang.String html)
Add HTML paragraphstatic com.lowagie.text.Section
addSection(com.lowagie.text.Document d, com.lowagie.text.Chapter chapter, java.lang.String title, PDFTool.PDFEvent event, boolean isOpen)
static com.lowagie.text.Section
addSection(com.lowagie.text.Document d, com.lowagie.text.Section section, java.lang.String title, PDFTool.PDFEvent event, boolean isOpen)
static com.lowagie.text.Document
build(com.lowagie.text.Rectangle pageSize, PDFTool.PDFInterface pdf, java.lang.String pdfPath, boolean replace)
Build a simple PDF documentstatic com.lowagie.text.Document
build(com.lowagie.text.Rectangle pageSize, PDFTool.PDFInterface pdf, java.lang.String pdfPath, boolean replace, PDFTool.PDFEvent event, int tocPage, int tocDepth)
Build a PDF documentstatic com.lowagie.text.Document
build(PDFTool.PDFInterface pdf, java.lang.String pdfPath, boolean replace)
static void
close(com.lowagie.text.Document d)
Close a documentstatic byte[]
concat(byte[] in1, byte[] in2)
Concat PDFstatic void
concat(java.io.File out, java.io.File in1, java.io.File in2)
Concat PDFstatic void
concat(java.io.OutputStream os, java.io.InputStream is1, java.io.InputStream is2)
Concat PDFstatic void
concat(java.lang.String out, java.lang.String in1, java.lang.String in2)
Concat PDFstatic void
export(ObjectDB obj, java.util.List<java.lang.String[]> rows, java.lang.String mode, java.io.OutputStream out)
Export list to PDFstatic java.lang.String
export(ObjectDB obj, java.util.List<java.lang.String[]> rows, java.lang.String mode, javax.servlet.http.HttpServletResponse response)
Export list to PDFstatic com.lowagie.text.pdf.PdfPCell
getCell(java.lang.String text)
Build a Table cellstatic com.lowagie.text.pdf.PdfPCell
getCell(java.lang.String text, com.lowagie.text.Font font, int align, boolean border, java.awt.Color color)
Build a Table cellstatic com.lowagie.text.pdf.PdfPCell
getCellImage(java.lang.String path, java.awt.Color bkg)
static com.lowagie.text.pdf.PdfPCell
getColoredCell(java.awt.Color color, boolean border)
Build an empty colored cellstatic com.lowagie.text.pdf.PdfPCell
getDecalCell(java.lang.String text, com.lowagie.text.Font font, int align, boolean border, java.awt.Color color)
Build decaled cell on the rightstatic PDFTool.PDFEvent
getDocEvent(boolean pagine, int margin, byte[] headerImg, byte[] footerImg)
Build a document event handlerstatic PDFTool.PDFEvent
getDocEvent(boolean pagine, int margin, java.lang.String headerImg, java.lang.String footerImg)
Build a document event handlerstatic com.lowagie.text.pdf.PdfPCell
getHeaderCell(java.lang.String text, int align, java.awt.Color color)
Build a header cellstatic com.lowagie.text.pdf.PdfPCell
getHeaderCell(java.lang.String text, java.awt.Color color)
Build a header cellstatic com.lowagie.text.pdf.PdfPCell
getHeaderCellVertical(java.lang.String text, java.awt.Color color)
Build a header cell with vertical textstatic com.lowagie.text.Image
getImage(byte[] data)
Get an image from specified byte array datastatic com.lowagie.text.Image
getImage(java.lang.String path)
Get an image from specified file pathstatic com.lowagie.text.Image
getImageFromDBDoc(Grant g, DocumentDB doc)
Get image from from DBDoc imagestatic com.lowagie.text.Image
getImageFromDBDoc(Grant g, java.lang.String docId)
Get image from DBDoc imagestatic com.lowagie.text.Image
getImageFromResource(ExternalObject ext, java.lang.String resourceCode)
Get image from external object resource imagestatic com.lowagie.text.Image
getImageFromResource(Grant g, java.lang.String resourceCode)
Get image from disposition resource imagestatic com.lowagie.text.Image
getImageFromResource(Grant g, java.lang.String resourceCode, java.lang.String objectName, java.lang.String objectId)
Get image from resource imagestatic com.lowagie.text.Image
getImageFromResource(ObjectDB obj, java.lang.String resourceCode)
Get image from object resource imagestatic com.lowagie.text.Image
getImageFromStaticContent(Grant g, java.lang.String relativePath)
Deprecated.Use getImageFromStaticContent without grant argumentstatic com.lowagie.text.Image
getImageFromStaticContent(java.lang.String relativePath)
Get image from static contentstatic com.lowagie.text.Image
getImageFromStaticResource(java.lang.String path)
Get image from static resourcestatic com.lowagie.text.Paragraph
getLovParagraph(ObjectField f)
static com.lowagie.text.pdf.PdfPTable
getTable(int[] cols, boolean header)
Build a PDF tablestatic com.lowagie.text.pdf.PdfPTable
getTable(int[] cols, boolean header, int spacingBefore, int spacingAfter)
Build a PDF tablestatic com.lowagie.text.pdf.PdfPTable
getTable(int nbcols, boolean header)
Build a PDF tablestatic java.lang.String
getValue(ObjectDB o, ObjectField f, boolean lovCode)
static com.lowagie.text.pdf.PdfPTable
insertFieldArea(com.lowagie.text.Document d, ObjectDB o, FieldArea fa, java.awt.Color bkg, boolean lovCode, boolean emptyValues)
Insert a field area as a table of 2 columnsstatic void
insertForm(com.lowagie.text.Document d, ObjectDB o, java.awt.Color bkg, boolean lovCode)
Insert object form in PDF (flow of field areas)static void
insertForm(com.lowagie.text.Document d, ObjectDB o, java.awt.Color bkg, boolean lovCode, boolean emptyValues)
Insert object form in PDF (flow of field areas)static void
insertImage(com.lowagie.text.Document d, com.lowagie.text.Image img, boolean canRotate, int align)
Insert one image into the documentstatic void
insertList(com.lowagie.text.Document d, ObjectDB o, boolean splitOption, boolean splitBoolean, boolean splitLongText, boolean lov, java.awt.Color headColor, boolean lovCode)
Generic method to serialize one object current list in distinct PDF tables : Mandatories, Options, Booleans, Long text/HTML, imagesstatic void
insertList(com.lowagie.text.Document d, ObjectDB o, java.util.List<ObjectField> cols, java.util.List<ObjectField> options, java.util.List<ObjectField> bools, java.util.List<ObjectField> larges, boolean lov, java.awt.Color headColor, boolean lovCode)
static com.lowagie.text.Document
open(com.lowagie.text.Rectangle pageSize, java.io.OutputStream out, PDFTool.PDFEvent event)
Open a new PDF document with output streamstatic com.lowagie.text.Document
open(com.lowagie.text.Rectangle pageSize, java.lang.String pdfPath, boolean replace, PDFTool.PDFEvent event)
Open a new PDF document with file outputstatic com.lowagie.text.Document
open(java.io.OutputStream out)
Open a new PDF document A4 with output streamstatic com.lowagie.text.Document
open(java.io.OutputStream out, PDFTool.PDFEvent event)
Open a new PDF document A4 with output streamstatic void
stamp(java.io.InputStream in, java.io.OutputStream out, byte[] image, float posX, float posY)
Stamp an existing PDF with an image on each pagesstatic byte[]
substitute(byte[] data, java.util.Map<java.lang.String,java.lang.String> substitutions)
Substitute strings in a PDF document as byte arraystatic void
substitute(java.io.File in, java.io.File out, java.util.Map<java.lang.String,java.lang.String> substitutions)
Substitute strings in a PDF document filestatic void
substitute(java.io.InputStream in, java.io.OutputStream out, java.util.Map<java.lang.String,java.lang.String> substitutions)
Substitute strings in a PDF documentstatic void
substitute(java.lang.String in, java.lang.String out, java.util.Map<java.lang.String,java.lang.String> substitutions)
Substitute strings in a PDF document filestatic org.apache.pdfbox.pdmodel.PDDocument
substitute(org.apache.pdfbox.pdmodel.PDDocument document, java.util.Map<java.lang.String,java.lang.String> substitutions)
Substitute strings in a PDF document
-
-
-
Field Detail
-
TITLE0
public static final com.lowagie.text.Font TITLE0
-
TITLE1
public static final com.lowagie.text.Font TITLE1
-
TITLE2
public static final com.lowagie.text.Font TITLE2
-
HEADER
public static final com.lowagie.text.Font HEADER
-
BOLD
public static final com.lowagie.text.Font BOLD
-
NORMAL
public static final com.lowagie.text.Font NORMAL
-
MEDIUM
public static final com.lowagie.text.Font MEDIUM
-
SMALL
public static final com.lowagie.text.Font SMALL
-
TINY
public static final com.lowagie.text.Font TINY
-
MONO
public static final com.lowagie.text.Font MONO
-
CODE
public static final com.lowagie.text.Font CODE
-
SCRIPT
@Deprecated(forRemoval=true, since="4.0") public static final com.lowagie.text.Font SCRIPT
Deprecated, for removal: This API element is subject to removal in a future version.
-
EMPTY
public static final com.lowagie.text.Paragraph EMPTY
-
CELL_WHITE
public static final com.lowagie.text.pdf.PdfPCell CELL_WHITE
-
CELL_GRAY
public static final com.lowagie.text.pdf.PdfPCell CELL_GRAY
-
CELL_BLACK
public static final com.lowagie.text.pdf.PdfPCell CELL_BLACK
-
IMAGE_COLOR
public static final java.awt.Color IMAGE_COLOR
-
EURO
public static final java.lang.String EURO
- See Also:
- Constant Field Values
-
IMAGE_SCALE
public static final float IMAGE_SCALE
- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public static com.lowagie.text.Document build(PDFTool.PDFInterface pdf, java.lang.String pdfPath, boolean replace)
-
build
public static com.lowagie.text.Document build(com.lowagie.text.Rectangle pageSize, PDFTool.PDFInterface pdf, java.lang.String pdfPath, boolean replace)
Build a simple PDF document- Parameters:
pageSize
- such as PageSize.A4 or PageSize.A4.rotate()pdf
- Interface to implement the contentpdfPath
- File pathreplace
- True to delete any older doc, False to stop if already exists- Returns:
- Document or null
-
build
public static com.lowagie.text.Document build(com.lowagie.text.Rectangle pageSize, PDFTool.PDFInterface pdf, java.lang.String pdfPath, boolean replace, PDFTool.PDFEvent event, int tocPage, int tocDepth)
Build a PDF document- Parameters:
pageSize
- such as PageSize.A4 or PageSize.A4.rotate()pdf
- Interface to implement the contentpdfPath
- File pathreplace
- True to delete any older doc, False to stop if already existsevent
- Doc event (may be null)tocPage
- Insert a table of content in the given page, 0 = no TOCtocDepth
- Table of content depth (chapter=1, section=2, sub-section=3...)- Returns:
- Document or null
-
open
public static com.lowagie.text.Document open(com.lowagie.text.Rectangle pageSize, java.lang.String pdfPath, boolean replace, PDFTool.PDFEvent event)
Open a new PDF document with file output
- Parameters:
pdfPath
- File pathreplace
- True to delete any older doc, False to stop if already existsevent
- Doc event (may be null)- Returns:
- A document or null
-
open
public static final com.lowagie.text.Document open(java.io.OutputStream out)
Open a new PDF document A4 with output stream
- Parameters:
out
- Output stream (can be HTTP response output stream of file output stream)- Returns:
- A document or null
-
open
public static final com.lowagie.text.Document open(java.io.OutputStream out, PDFTool.PDFEvent event)
Open a new PDF document A4 with output stream
- Parameters:
out
- Output stream (can be HTTP response output stream of file output stream)event
- Doc event (may be null)- Returns:
- A document or null
-
open
public static com.lowagie.text.Document open(com.lowagie.text.Rectangle pageSize, java.io.OutputStream out, PDFTool.PDFEvent event)
Open a new PDF document with output stream
- Parameters:
pageSize
- such as PageSize.A4 or PageSize.A4.rotate()out
- Output stream (can be HTTP response output stream of file output stream)event
- Doc event (may be null)- Returns:
- A document or null
-
close
public static void close(com.lowagie.text.Document d)
Close a document
- Parameters:
d
- Opened document
-
stamp
public static final void stamp(java.io.InputStream in, java.io.OutputStream out, byte[] image, float posX, float posY) throws java.lang.Exception
Stamp an existing PDF with an image on each pages
- Parameters:
in
- Input stream of source PDFout
- Output stream of destination PDFimage
- Image dataposX
- Absolute position XposY
- Absolute position Y- Throws:
java.lang.Exception
-
getDocEvent
public static PDFTool.PDFEvent getDocEvent(boolean pagine, int margin, java.lang.String headerImg, java.lang.String footerImg)
Build a document event handler- Parameters:
pagine
- True to display the page numbers on page bottommargin
- Border margin in pixelsheaderImg
- Path to the header imagefooterImg
- Path to the footer image- Returns:
- event or null if file read fails
-
getDocEvent
public static PDFTool.PDFEvent getDocEvent(boolean pagine, int margin, byte[] headerImg, byte[] footerImg)
Build a document event handler- Parameters:
pagine
- True to display the page numbers on page bottommargin
- Border margin in pixelsheaderImg
- Header image datafooterImg
- Footer image data- Returns:
- event
-
addChapter
public static com.lowagie.text.Chapter addChapter(com.lowagie.text.Document d, java.lang.String title, PDFTool.PDFEvent event, boolean isOpen) throws com.lowagie.text.DocumentException
- Throws:
com.lowagie.text.DocumentException
-
addSection
public static com.lowagie.text.Section addSection(com.lowagie.text.Document d, com.lowagie.text.Chapter chapter, java.lang.String title, PDFTool.PDFEvent event, boolean isOpen) throws com.lowagie.text.DocumentException
- Throws:
com.lowagie.text.DocumentException
-
addSection
public static com.lowagie.text.Section addSection(com.lowagie.text.Document d, com.lowagie.text.Section section, java.lang.String title, PDFTool.PDFEvent event, boolean isOpen) throws com.lowagie.text.DocumentException
- Throws:
com.lowagie.text.DocumentException
-
getCell
public static com.lowagie.text.pdf.PdfPCell getCell(java.lang.String text)
Build a Table cell
- Parameters:
text
- Simple text- Returns:
- Table cell
-
getCell
public static com.lowagie.text.pdf.PdfPCell getCell(java.lang.String text, com.lowagie.text.Font font, int align, boolean border, java.awt.Color color)
Build a Table cell
- Parameters:
text
- Simple textfont
- Font to usealign
- Alignmentborder
- True to draw the bordercolor
- Background color- Returns:
- Table cell
-
getHeaderCell
public static com.lowagie.text.pdf.PdfPCell getHeaderCell(java.lang.String text, int align, java.awt.Color color)
Build a header cell
- Parameters:
text
- header textalign
- cell alignment- Returns:
- Table cell
-
getHeaderCell
public static com.lowagie.text.pdf.PdfPCell getHeaderCell(java.lang.String text, java.awt.Color color)
Build a header cell
- Parameters:
text
- Text- Returns:
- Table cell
-
getHeaderCellVertical
public static com.lowagie.text.pdf.PdfPCell getHeaderCellVertical(java.lang.String text, java.awt.Color color)
Build a header cell with vertical text
- Parameters:
text
- Text- Returns:
- Table cell
-
getColoredCell
public static com.lowagie.text.pdf.PdfPCell getColoredCell(java.awt.Color color, boolean border)
Build an empty colored cell
- Parameters:
color
- Background colorborder
- True to draw the border- Returns:
- Table cell
-
getDecalCell
public static com.lowagie.text.pdf.PdfPCell getDecalCell(java.lang.String text, com.lowagie.text.Font font, int align, boolean border, java.awt.Color color)
Build decaled cell on the right
- Returns:
- Table cell
-
getTable
public static com.lowagie.text.pdf.PdfPTable getTable(int[] cols, boolean header, int spacingBefore, int spacingAfter) throws com.lowagie.text.DocumentException
Build a PDF table
- Parameters:
cols
- Table of column sizes or percents; table size = nbr of columns- Returns:
- PDF Table
- Throws:
com.lowagie.text.DocumentException
-
getTable
public static com.lowagie.text.pdf.PdfPTable getTable(int[] cols, boolean header) throws com.lowagie.text.DocumentException
Build a PDF table
- Parameters:
cols
- Table of columns size in percents; table size = nbr of columnsheader
- True to display a header line- Returns:
- PDF Table
- Throws:
com.lowagie.text.DocumentException
-
getTable
public static com.lowagie.text.pdf.PdfPTable getTable(int nbcols, boolean header) throws com.lowagie.text.DocumentException
Build a PDF table
- Parameters:
nbcols
- Nb of columnsheader
- True to display a header line- Returns:
- PDF Table
- Throws:
com.lowagie.text.DocumentException
-
insertList
public static void insertList(com.lowagie.text.Document d, ObjectDB o, boolean splitOption, boolean splitBoolean, boolean splitLongText, boolean lov, java.awt.Color headColor, boolean lovCode) throws com.lowagie.text.DocumentException
Generic method to serialize one object current list in distinct PDF tables : Mandatories, Options, Booleans, Long text/HTML, images- Parameters:
d
- Documento
- ObjectsplitOption
- Put the optional fields after the main tablesplitBoolean
- Put the boolean fields after the main tablesplitLongText
- Put the large fields after the main tablelov
- True to insert the lists of values after all- Throws:
com.lowagie.text.DocumentException
-
insertList
public static void insertList(com.lowagie.text.Document d, ObjectDB o, java.util.List<ObjectField> cols, java.util.List<ObjectField> options, java.util.List<ObjectField> bools, java.util.List<ObjectField> larges, boolean lov, java.awt.Color headColor, boolean lovCode) throws com.lowagie.text.DocumentException
- Throws:
com.lowagie.text.DocumentException
-
getValue
public static java.lang.String getValue(ObjectDB o, ObjectField f, boolean lovCode)
-
getCellImage
public static com.lowagie.text.pdf.PdfPCell getCellImage(java.lang.String path, java.awt.Color bkg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getLovParagraph
public static com.lowagie.text.Paragraph getLovParagraph(ObjectField f)
-
addHTMLParagraph
public static com.lowagie.text.Paragraph addHTMLParagraph(java.lang.String html)
Add HTML paragraph- Parameters:
html
- HTML
-
insertForm
public static void insertForm(com.lowagie.text.Document d, ObjectDB o, java.awt.Color bkg, boolean lovCode, boolean emptyValues) throws com.lowagie.text.DocumentException
Insert object form in PDF (flow of field areas)- Parameters:
d
- Documento
- Objectbkg
- Field name backgroundlovCode
- Display LOV code or labelemptyValues
- true to display empty values- Throws:
com.lowagie.text.DocumentException
-
insertForm
public static void insertForm(com.lowagie.text.Document d, ObjectDB o, java.awt.Color bkg, boolean lovCode) throws com.lowagie.text.DocumentException
Insert object form in PDF (flow of field areas)- Parameters:
d
- Documento
- Objectbkg
- Field name backgroundlovCode
- Display LOV code or label- Throws:
com.lowagie.text.DocumentException
-
insertFieldArea
public static com.lowagie.text.pdf.PdfPTable insertFieldArea(com.lowagie.text.Document d, ObjectDB o, FieldArea fa, java.awt.Color bkg, boolean lovCode, boolean emptyValues) throws com.lowagie.text.DocumentException
Insert a field area as a table of 2 columns- Parameters:
d
- Document (optional)o
- Objectfa
- Field areabkg
- Field name backgroundlovCode
- Display LOV code or labelemptyValues
- true to display empty values- Throws:
com.lowagie.text.DocumentException
-
getImageFromDBDoc
public static com.lowagie.text.Image getImageFromDBDoc(Grant g, java.lang.String docId)
Get image from DBDoc image- Parameters:
g
- GrantdocId
- Image document ID
-
getImageFromDBDoc
public static com.lowagie.text.Image getImageFromDBDoc(Grant g, DocumentDB doc)
Get image from from DBDoc image- Parameters:
g
- Grantdoc
- Image document
-
getImageFromResource
public static com.lowagie.text.Image getImageFromResource(Grant g, java.lang.String resourceCode)
Get image from disposition resource image- Parameters:
g
- GrantresourceCode
- Resource code
-
getImageFromResource
public static com.lowagie.text.Image getImageFromResource(ObjectDB obj, java.lang.String resourceCode)
Get image from object resource image- Parameters:
obj
- ObjectresourceCode
- Resource code
-
getImageFromResource
public static com.lowagie.text.Image getImageFromResource(ExternalObject ext, java.lang.String resourceCode)
Get image from external object resource image- Parameters:
ext
- External objectresourceCode
- Resource code
-
getImageFromResource
public static com.lowagie.text.Image getImageFromResource(Grant g, java.lang.String resourceCode, java.lang.String objectName, java.lang.String objectId)
Get image from resource image- Parameters:
g
- GrantresourceCode
- Resource codeobjectName
- Object name (typically Disposition, ObjectInternal or ObjectExternal)objectId
- Object ID
-
getImageFromStaticResource
public static com.lowagie.text.Image getImageFromStaticResource(java.lang.String path)
Get image from static resource- Parameters:
path
- Static image resource path
-
getImageFromStaticContent
@Deprecated(forRemoval=false, since="5") public static com.lowagie.text.Image getImageFromStaticContent(Grant g, java.lang.String relativePath)
Deprecated.Use getImageFromStaticContent without grant argument
-
getImageFromStaticContent
public static com.lowagie.text.Image getImageFromStaticContent(java.lang.String relativePath)
Get image from static content- Parameters:
relativePath
- Static content image relative path
-
getImage
public static com.lowagie.text.Image getImage(java.lang.String path)
Get an image from specified file path- Parameters:
path
- Absolute path to image file
-
getImage
public static com.lowagie.text.Image getImage(byte[] data)
Get an image from specified byte array data- Parameters:
data
- Image data
-
insertImage
public static void insertImage(com.lowagie.text.Document d, com.lowagie.text.Image img, boolean canRotate, int align)
Insert one image into the document- Parameters:
d
- PDF documentimg
- ImagecanRotate
- True to rotate the image when larger than doc widthalign
- Image alignment ex: Image.MIDDLE
-
concat
public static void concat(java.lang.String out, java.lang.String in1, java.lang.String in2) throws java.lang.Exception
Concat PDF- Parameters:
out
- Output filenamein1
- Input filename 1in2
- Input filename 2- Throws:
java.lang.Exception
-
concat
public static void concat(java.io.File out, java.io.File in1, java.io.File in2) throws java.lang.Exception
Concat PDF- Parameters:
out
- Output filein1
- Input file 1in2
- Input file 2- Throws:
java.lang.Exception
-
concat
public static byte[] concat(byte[] in1, byte[] in2) throws java.lang.Exception
Concat PDF- Parameters:
in1
- Input file content 1in2
- Input file content 2- Returns:
- Concatenated file content
- Throws:
java.lang.Exception
-
concat
public static void concat(java.io.OutputStream os, java.io.InputStream is1, java.io.InputStream is2) throws java.lang.Exception
Concat PDF- Parameters:
os
- Output streamis1
- Input stream 1is2
- Input stream 2- Throws:
java.lang.Exception
-
export
public static java.lang.String export(ObjectDB obj, java.util.List<java.lang.String[]> rows, java.lang.String mode, javax.servlet.http.HttpServletResponse response)
Export list to PDF- Parameters:
obj
- Objectrows
- Data recordsmode
- full or listresponse
- optional HTTP response- Returns:
- temp file name if response is null
-
export
public static void export(ObjectDB obj, java.util.List<java.lang.String[]> rows, java.lang.String mode, java.io.OutputStream out)
Export list to PDF- Parameters:
obj
- Objectrows
- Data recordsmode
- full or listout
- Output stream
-
substitute
public static void substitute(java.lang.String in, java.lang.String out, java.util.Map<java.lang.String,java.lang.String> substitutions) throws java.io.IOException
Substitute strings in a PDF document file- Parameters:
in
- Input PDF document file pathout
- Output PDF document file pathsubstitutions
- Map of strings to substitute- Throws:
java.io.IOException
-
substitute
public static void substitute(java.io.File in, java.io.File out, java.util.Map<java.lang.String,java.lang.String> substitutions) throws java.io.IOException
Substitute strings in a PDF document file- Parameters:
in
- Input PDF document fileout
- Output PDF document file with strings substitutedsubstitutions
- Map of strings to substitute- Throws:
java.io.IOException
-
substitute
public static void substitute(java.io.InputStream in, java.io.OutputStream out, java.util.Map<java.lang.String,java.lang.String> substitutions) throws java.io.IOException
Substitute strings in a PDF document- Parameters:
in
- PDF document input streamout
- PDF document output stream with strings substitutedsubstitutions
- Map of strings to substitute- Throws:
java.io.IOException
-
substitute
public static byte[] substitute(byte[] data, java.util.Map<java.lang.String,java.lang.String> substitutions) throws java.io.IOException
Substitute strings in a PDF document as byte array- Parameters:
data
- Input PDF document byte array datasubstitutions
- Map of strings to substitute- Returns:
- Output PDF document with strings substituted as byte array
- Throws:
java.io.IOException
-
substitute
public static org.apache.pdfbox.pdmodel.PDDocument substitute(org.apache.pdfbox.pdmodel.PDDocument document, java.util.Map<java.lang.String,java.lang.String> substitutions) throws java.io.IOException
Substitute strings in a PDF document- Parameters:
document
- PDF documentsubstitutions
- Map of strings to substitute- Returns:
- Document with strings substituted
- Throws:
java.io.IOException
-
-