org.apache.pdfbox.examples.pdmodel
Class ImageToPDF

java.lang.Object
  extended by org.apache.pdfbox.examples.pdmodel.ImageToPDF

public class ImageToPDF
extends Object

This is an example that creates a simple document. The example is taken from the pdf file format specification.

Version:
$Revision: 1.7 $
Author:
Ben Litchfield

Constructor Summary
ImageToPDF()
           
 
Method Summary
 void createPDFFromImage(String file, String image)
          create the second sample document from the PDF file format specification.
static void main(String[] args)
          This will create a PDF document with a single image on it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageToPDF

public ImageToPDF()
Method Detail

createPDFFromImage

public void createPDFFromImage(String file,
                               String image)
                        throws IOException,
                               COSVisitorException
create the second sample document from the PDF file format specification.

Parameters:
file - The file to write the PDF to.
image - The filename of the image to put in the PDF.
Throws:
IOException - If there is an error writing the data.
COSVisitorException - If there is an error writing the PDF.

main

public static void main(String[] args)
This will create a PDF document with a single image on it.
see usage() for commandline

Parameters:
args - Command line arguments.


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