|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.examples.pdmodel.ReplaceString
public class ReplaceString
This is an example that will replace a string in a PDF with a new one. The example is taken from the pdf file format specification.
Constructor Summary | |
---|---|
ReplaceString()
Constructor. |
Method Summary | |
---|---|
void |
doIt(java.lang.String inputFile,
java.lang.String outputFile,
java.lang.String strToFind,
java.lang.String message)
Locate a string in a PDF and replace it with a new string. |
static void |
main(java.lang.String[] args)
This will open a PDF and replace a string if it finds it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplaceString()
Method Detail |
---|
public void doIt(java.lang.String inputFile, java.lang.String outputFile, java.lang.String strToFind, java.lang.String message) throws java.io.IOException, COSVisitorException
inputFile
- The PDF to open.outputFile
- The PDF to write to.strToFind
- The string to find in the PDF document.message
- The message to write in the file.
java.io.IOException
- If there is an error writing the data.
COSVisitorException
- If there is an error writing the PDF.public static void main(java.lang.String[] args)
args
- Command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |