|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.pdfbox.examples.persistence.AppendAndFillDoc
This concatenates two documents with fields and fills the fields in the two templates using different values.
| Constructor Summary | |
AppendAndFillDoc()
Constructor. |
|
| Method Summary | |
void |
appendDocument(COSDocument destination,
COSDocument source)
Append all pages from source to destination. |
void |
appendPage(COSDocument destination,
COSDictionary page)
append a page dict to destination. |
void |
doIt(String in1,
String in2,
String out,
String name1,
String value1,
String name2,
String value2)
concat two pdf documents and fill fields in both templates this is a bit tricky as one has to rename the fields if we use the same template two times. |
COSDictionary |
getPages(COSDocument doc)
Lookup the pages dictionary in a document. |
static void |
main(String[] args)
This will concat two pdf documents and fill fields in both. |
void |
setField(COSDocument doc,
String prefix,
COSString name,
COSString value)
lookup and fill the field. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AppendAndFillDoc()
| Method Detail |
public void appendDocument(COSDocument destination,
COSDocument source)
destination - the document to receive the pagessource - the document originating the new pages
public void appendPage(COSDocument destination,
COSDictionary page)
destination - the document to receive the pagepage - the page to append to the document
public void doIt(String in1,
String in2,
String out,
String name1,
String value1,
String name2,
String value2)
throws IOException,
COSVisitorException
in1 - The first template filein2 - The second template fileout - The created fiel with all pages from document one and document twoname1 - The name of the PDF field (FDF field) in the first templatevalue1 - The value to be used for the field in the first templatename2 - The name of the PDF field (FDF field) in the second templatevalue2 - The value to be used for the field in the second template
IOException - If there is an error writing the data.
COSVisitorException - If there is an error generating the PDF document.public COSDictionary getPages(COSDocument doc)
doc - the document where the pages dict is searched
public static void main(String[] args)
args - command line arguments
public void setField(COSDocument doc,
String prefix,
COSString name,
COSString value)
doc - the document where the field residesprefix - a prefix to use to make the field name unique in the new documentname - the name of the PDF Annotation fieldvalue - The desired value to be used for the field
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||