com.pdfjet
Class PDF

java.lang.Object
  extended by com.pdfjet.PDF

public class PDF
extends java.lang.Object

Used to create PDF objects that represent PDF documents.


Constructor Summary
PDF()
          The default constructor - use when reading PDF files.
PDF(java.io.OutputStream os)
          Creates a PDF object that represents a PDF document.
PDF(java.io.OutputStream os, int compliance)
          Creates a PDF object that represents a PDF document.
 
Method Summary
 void addObjects(java.util.Map<java.lang.Integer,PDFobj> objects)
           
 int addOutlineDict(Bookmark toc)
           
 void addOutlineItem(int parent, int i, Bookmark bm1)
           
 void addPage(Page page)
           
 void close()
          Writes the PDF object to the output stream and closes it.
 void flush()
          Writes the PDF object to the output stream.
 java.util.List<PDFobj> getPageObjects(java.util.Map<java.lang.Integer,PDFobj> objects)
           
 java.util.Map<java.lang.Integer,PDFobj> read(java.io.InputStream inputStream)
          Returns a list of objects of type PDFobj read from input stream.
 void setAuthor(java.lang.String author)
          Set the "Author" document property of the PDF file.
 void setPageLayout(java.lang.String pageLayout)
           
 void setPageMode(java.lang.String pageMode)
           
 void setSubject(java.lang.String subject)
          Set the "Subject" document property of the PDF file.
 void setTitle(java.lang.String title)
          Set the "Title" document property of the PDF file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDF

public PDF()
    throws java.lang.Exception
The default constructor - use when reading PDF files.

Throws:
java.lang.Exception

PDF

public PDF(java.io.OutputStream os)
    throws java.lang.Exception
Creates a PDF object that represents a PDF document.

Parameters:
os - the associated output stream.
Throws:
java.lang.Exception

PDF

public PDF(java.io.OutputStream os,
           int compliance)
    throws java.lang.Exception
Creates a PDF object that represents a PDF document. Use this constructor to create PDF/A compliant PDF documents. Please note: PDF/A compliance requires all fonts to be embedded in the PDF.

Parameters:
os - the associated output stream.
compliance - must be: Compliance.PDF_A_1B
Throws:
java.lang.Exception
Method Detail

addPage

public void addPage(Page page)
             throws java.lang.Exception
Throws:
java.lang.Exception

flush

public void flush()
           throws java.lang.Exception
Writes the PDF object to the output stream. Does not close the underlying output stream.

Throws:
java.lang.Exception

close

public void close()
           throws java.lang.Exception
Writes the PDF object to the output stream and closes it.

Throws:
java.lang.Exception

setTitle

public void setTitle(java.lang.String title)
Set the "Title" document property of the PDF file.

Parameters:
title - The title of this document.

setSubject

public void setSubject(java.lang.String subject)
Set the "Subject" document property of the PDF file.

Parameters:
subject - The subject of this document.

setAuthor

public void setAuthor(java.lang.String author)
Set the "Author" document property of the PDF file.

Parameters:
author - The author of this document.

setPageLayout

public void setPageLayout(java.lang.String pageLayout)

setPageMode

public void setPageMode(java.lang.String pageMode)

read

public java.util.Map<java.lang.Integer,PDFobj> read(java.io.InputStream inputStream)
                                             throws java.lang.Exception
Returns a list of objects of type PDFobj read from input stream.

Parameters:
inputStream - the PDF input stream.
Returns:
List the list of PDF objects.
Throws:
java.lang.Exception

addObjects

public void addObjects(java.util.Map<java.lang.Integer,PDFobj> objects)
                throws java.lang.Exception
Throws:
java.lang.Exception

getPageObjects

public java.util.List<PDFobj> getPageObjects(java.util.Map<java.lang.Integer,PDFobj> objects)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

addOutlineDict

public int addOutlineDict(Bookmark toc)
                   throws java.lang.Exception
Throws:
java.lang.Exception

addOutlineItem

public void addOutlineItem(int parent,
                           int i,
                           Bookmark bm1)
                    throws java.lang.Exception
Throws:
java.lang.Exception