Class SetField
java.lang.Object
org.apache.pdfbox.examples.interactive.form.SetField
This example will take a PDF document and set a form field in it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringcalculateOutputFilename(String filename) static voidThis will read a PDF file and set a field and then write it the pdf out again.private voidvoidsetField(PDDocument pdfDocument, String name, String value) This will set a single field in the document.private static voidusage()This will print out a message telling how to use this example.
-
Constructor Details
-
SetField
public SetField()
-
-
Method Details
-
setField
This will set a single field in the document.- Parameters:
pdfDocument- The PDF to set the field in.name- The name of the field to set.value- The new value of the field.- Throws:
IOException- If there is an error setting the field.
-
main
This will read a PDF file and set a field and then write it the pdf out again.
see usage() for commandline- Parameters:
args- command line arguments- Throws:
IOException- If there is an error importing the FDF document.
-
setField
- Throws:
IOException
-
calculateOutputFilename
-
usage
private static void usage()This will print out a message telling how to use this example.
-