|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.lowagie.text.Document
com.lowagie.text.pdf.PdfDocument
PdfDocument is the class that is used by PdfWriter
to translate a Document into a PDF with different pages.
A PdfDocument always listens to a Document
and adds the Pdf representation of every Element that is
added to the Document.
Document,
DocListener,
PdfWriter| Nested Class Summary | |
static class |
PdfDocument.Indentation
|
static class |
PdfDocument.PdfInfo
PdfInfo is the PDF InfoDictionary.
|
| Field Summary |
| Fields inherited from class com.lowagie.text.Document |
compress, plainRandomAccess, wmfFontCorrection |
| Constructor Summary | |
PdfDocument()
Constructs a new PDF document. |
|
| Method Summary | |
boolean |
add(Element element)
Signals that an Element was added to the Document. |
void |
addWriter(PdfWriter writer)
Adds a PdfWriter to the PdfDocument. |
void |
clearTextWrap()
Method added by Pelikan Stephan |
void |
close()
Closes the document. |
float |
getLeading()
Getter for the current leading. |
PdfOutline |
getRootOutline()
Gets the root outline. |
float |
getVerticalPosition(boolean ensureNewLine)
Gets the current vertical page position. |
boolean |
newPage()
Makes a new page and sends it to the PdfWriter. |
void |
open()
Opens the document. |
void |
resetFooter()
Resets the footer of this document. |
void |
resetHeader()
Resets the header of this document. |
void |
resetPageCount()
Sets the page number to 0. |
void |
setCollection(PdfCollection collection)
Sets the collection dictionary. |
void |
setFooter(HeaderFooter footer)
Changes the footer of this document. |
void |
setHeader(HeaderFooter header)
Changes the header of this document. |
boolean |
setMarginMirroring(boolean MarginMirroring)
Set the margin mirroring. |
boolean |
setMargins(float marginLeft,
float marginRight,
float marginTop,
float marginBottom)
Sets the margins. |
void |
setPageCount(int pageN)
Sets the page number. |
boolean |
setPageSize(Rectangle pageSize)
Sets the pagesize. |
void |
setXmpMetadata(byte[] xmpMetadata)
Use this method to set the XMP Metadata. |
| Methods inherited from class com.lowagie.text.Document |
addAuthor, addCreationDate, addCreator, addDocListener, addHeader, addKeywords, addProducer, addSubject, addTitle, bottom, bottom, bottomMargin, getHtmlStyleClass, getJavaScript_onLoad, getJavaScript_onUnLoad, getPageNumber, getPageSize, getVersion, isMarginMirroring, isOpen, left, left, leftMargin, removeDocListener, right, right, rightMargin, setHtmlStyleClass, setJavaScript_onLoad, setJavaScript_onUnLoad, top, top, topMargin |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PdfDocument()
| Method Detail |
public void addWriter(PdfWriter writer)
throws DocumentException
PdfWriter to the PdfDocument.
writer - the PdfWriter that writes everything
what is added to this document to an outputstream.
DocumentException - on errorpublic float getLeading()
public boolean add(Element element)
throws DocumentException
Element was added to the Document.
add in interface ElementListeneradd in class Documentelement - the element to add
true if the element was added, false if not.
DocumentException - when a document isn't open yet, or has been closedpublic void open()
You have to open the document before you can begin to add content to the body of the document.
open in interface DocListeneropen in class Documentpublic void close()
close in interface DocListenerclose in class Documentpublic void setXmpMetadata(byte[] xmpMetadata)
xmpMetadata - The xmpMetadata to set.public boolean newPage()
PdfWriter.
newPage in interface DocListenernewPage in class Documentbooleanpublic boolean setPageSize(Rectangle pageSize)
setPageSize in interface DocListenersetPageSize in class DocumentpageSize - the new pagesize
true if the page size was set
public boolean setMargins(float marginLeft,
float marginRight,
float marginTop,
float marginBottom)
setMargins in interface DocListenersetMargins in class DocumentmarginLeft - the margin on the leftmarginRight - the margin on the rightmarginTop - the margin on the topmarginBottom - the margin on the bottom
booleanpublic boolean setMarginMirroring(boolean MarginMirroring)
Document
Note: it will not work with Table.
setMarginMirroring in interface DocListenersetMarginMirroring in class DocumentMarginMirroring - true to mirror the margins
trueDocListener.setMarginMirroring(boolean)public void setPageCount(int pageN)
setPageCount in interface DocListenersetPageCount in class DocumentpageN - the new page numberpublic void resetPageCount()
resetPageCount in interface DocListenerresetPageCount in class Documentpublic void setHeader(HeaderFooter header)
setHeader in interface DocListenersetHeader in class Documentheader - the new headerpublic void resetHeader()
resetHeader in interface DocListenerresetHeader in class Documentpublic void setFooter(HeaderFooter footer)
setFooter in interface DocListenersetFooter in class Documentfooter - the new footerpublic void resetFooter()
resetFooter in interface DocListenerresetFooter in class Documentpublic float getVerticalPosition(boolean ensureNewLine)
ensureNewLine - Tells whether a new line shall be enforced. This may cause side effects
for elements that do not terminate the lines they've started because those lines will get
terminated.
public PdfOutline getRootOutline()
public void setCollection(PdfCollection collection)
collection - a dictionary of type PdfCollectionpublic void clearTextWrap()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||