org.apache.pdfbox.examples.pdmodel
Class AddImageToPDF
java.lang.Object
org.apache.pdfbox.examples.pdmodel.AddImageToPDF
public class AddImageToPDF
- extends Object
This is an example that creates a reads a document and adds an image to it..
The example is taken from the pdf file format specification.
- Version:
- $Revision: 1.1 $
- Author:
- Ben Litchfield
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AddImageToPDF
public AddImageToPDF()
createPDFFromImage
public void createPDFFromImage(String inputFile,
String image,
String outputFile)
throws IOException,
org.apache.pdfbox.exceptions.COSVisitorException
- Add an image to an existing PDF document.
- Parameters:
inputFile - The input PDF to add the image to.image - The filename of the image to put in the PDF.outputFile - The file to write to the pdf to.
- Throws:
IOException - If there is an error writing the data.
org.apache.pdfbox.exceptions.COSVisitorException - If there is an error writing the PDF.
main
public static void main(String[] args)
- This will load a PDF document and add a single image on it.
see usage() for commandline
- Parameters:
args - Command line arguments.
Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.