org.apache.pdfbox.examples.fdf
Class SetField

java.lang.Object
  extended by org.apache.pdfbox.examples.AbstractExample
      extended by org.apache.pdfbox.examples.fdf.SetField

public class SetField
extends AbstractExample

This example will take a PDF document and set a FDF field in it.

Version:
$Revision: 1.7 $
Author:
Ben Litchfield

Constructor Summary
SetField()
           
 
Method Summary
static void main(String[] args)
          This will read a PDF file and set a field and then write it the pdf out again.
 void setField(PDDocument pdfDocument, String name, String value)
          This will set a single field in the document.
 
Methods inherited from class org.apache.pdfbox.examples.AbstractExample
close, close, close, close, close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetField

public SetField()
Method Detail

setField

public void setField(PDDocument pdfDocument,
                     String name,
                     String value)
              throws IOException
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

public static void main(String[] args)
                 throws IOException,
                        COSVisitorException
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.
COSVisitorException - If there is an error writing the PDF.


Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.