|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.DocWriter
com.lowagie.text.pdf.PdfWriter
com.lowagie.text.pdf.PdfStamperImp
class PdfStamperImp
| Nested Class Summary | |
|---|---|
(package private) static class |
PdfStamperImp.PageStamp
|
| Nested classes/interfaces inherited from class com.lowagie.text.pdf.PdfWriter |
|---|
PdfWriter.PdfBody, PdfWriter.PdfTrailer |
| Field Summary | |
|---|---|
protected AcroFields |
acroFields
|
protected boolean |
append
|
(package private) boolean |
closed
|
protected boolean |
fieldsAdded
|
protected HashMap |
fieldTemplates
|
(package private) RandomAccessFileOrArray |
file
|
protected boolean |
flat
|
protected boolean |
flatFreeText
|
protected int |
initialXrefSize
|
protected IntHashtable |
marked
|
(package private) IntHashtable |
myXref
|
protected int[] |
namePtr
|
protected PdfAction |
openAction
|
(package private) HashMap |
pagesToContent
Integer(page number) -> PageStamp |
protected HashSet |
partialFlattening
|
(package private) PdfReader |
reader
|
(package private) HashMap |
readers2file
|
(package private) HashMap |
readers2intrefs
|
private boolean |
rotateContents
Holds value of property rotateContents. |
protected int |
sigFlags
|
protected boolean |
useVp
|
protected PdfViewerPreferencesImp |
viewerPreferences
|
| Fields inherited from class com.lowagie.text.DocWriter |
|---|
closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TAB |
| Constructor Summary | |
|---|---|
PdfStamperImp(PdfReader reader,
OutputStream os,
char pdfVersion,
boolean append)
Creates new PdfStamperImp. |
|
| Method Summary | |
|---|---|
void |
addAnnotation(PdfAnnotation annot)
Use this methods to add a PdfAnnotation or a PdfFormField
to the document. |
(package private) void |
addAnnotation(PdfAnnotation annot,
int page)
|
(package private) void |
addAnnotation(PdfAnnotation annot,
PdfDictionary pageN)
|
void |
addComments(FdfReader fdf)
|
(package private) void |
addDocumentField(PdfIndirectReference ref)
|
(package private) void |
addFieldResources()
|
(package private) void |
addFileAttachments()
|
void |
addViewerPreference(PdfName key,
PdfObject value)
Adds a viewer preference |
(package private) void |
alterContents()
|
(package private) void |
alterResources(PdfStamperImp.PageStamp ps)
|
(package private) void |
applyRotation(PdfDictionary pageN,
ByteBuffer out)
|
(package private) void |
close(HashMap moreInfo)
|
(package private) void |
correctAcroFieldPages(int page)
|
(package private) void |
deleteOutlines()
|
(package private) void |
eliminateAcroformObjects()
|
(package private) void |
expandFields(PdfFormField field,
ArrayList allAnnots)
|
(package private) static void |
findAllObjects(PdfReader reader,
PdfObject obj,
IntHashtable hits)
|
(package private) void |
flatFields()
|
private void |
flatFreeTextFields()
|
(package private) AcroFields |
getAcroFields()
|
PdfContentByte |
getDirectContent()
Use this method to get the direct content for this document. |
PdfContentByte |
getDirectContentUnder()
Use this method to get the direct content under for this document. |
protected int |
getNewObjectNumber(PdfReader reader,
int number,
int generation)
|
(package private) PdfContentByte |
getOverContent(int pageNum)
|
PdfIndirectReference |
getPageReference(int page)
Use this method to get a reference to a page existing or not. |
(package private) PdfStamperImp.PageStamp |
getPageStamp(int pageNum)
|
(package private) RandomAccessFileOrArray |
getReaderFile(PdfReader reader)
|
(package private) PdfContentByte |
getUnderContent(int pageNum)
|
(package private) void |
insertPage(int pageNumber,
Rectangle mediabox)
|
(package private) boolean |
isAppend()
Getter for property append. |
(package private) boolean |
isContentWritten()
|
(package private) boolean |
isRotateContents()
Getter for property rotateContents. |
(package private) void |
makePackage(PdfCollection collection)
Adds or replaces the Collection Dictionary in the Catalog. |
protected void |
markUsed(int num)
|
protected void |
markUsed(PdfObject obj)
|
private void |
outlineTravel(PRIndirectReference outline)
|
(package private) boolean |
partialFormFlattening(String name)
|
void |
registerReader(PdfReader reader,
boolean openFile)
|
void |
setAdditionalAction(PdfName actionType,
PdfAction action)
Additional-actions defining the actions to be taken in response to various trigger events affecting the document as a whole. |
void |
setDuration(int seconds)
Always throws an UnsupportedOperationException. |
(package private) void |
setDuration(int seconds,
int page)
Sets the display duration for the page (for presentations) |
(package private) void |
setFormFlattening(boolean flat)
|
(package private) void |
setFreeTextFlattening(boolean flat)
|
(package private) void |
setJavaScript()
|
void |
setOpenAction(PdfAction action)
When the document opens this action will be
invoked. |
void |
setOpenAction(String name)
When the document opens it will jump to the destination with this name. |
(package private) void |
setOutlines()
|
void |
setPageAction(PdfName actionType,
PdfAction action)
Always throws an UnsupportedOperationException. |
(package private) void |
setPageAction(PdfName actionType,
PdfAction action,
int page)
Sets the open and close page additional action. |
(package private) void |
setRotateContents(boolean rotateContents)
Setter for property rotateContents. |
void |
setSigFlags(int f)
Set the signature flags. |
void |
setThumbnail(Image image)
Use this method to set the thumbnail image for the current page. |
(package private) void |
setThumbnail(Image image,
int page)
|
void |
setTransition(PdfTransition transition)
Always throws an UnsupportedOperationException. |
(package private) void |
setTransition(PdfTransition transition,
int page)
Sets the transition for the page |
void |
setViewerPreferences(int preferences)
Sets the viewer preferences. |
(package private) void |
sweepKids(PdfObject obj)
|
void |
unRegisterReader(PdfReader reader)
|
| Methods inherited from class com.lowagie.text.DocWriter |
|---|
add, addTabs, flush, getISOBytes, isCloseStream, isPaused, newPage, pause, resetFooter, resetHeader, resetPageCount, resume, setCloseStream, setFooter, setHeader, setMarginMirroring, setMargins, setPageCount, setPageSize, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
HashMap readers2intrefs
HashMap readers2file
RandomAccessFileOrArray file
PdfReader reader
IntHashtable myXref
HashMap pagesToContent
boolean closed
private boolean rotateContents
protected AcroFields acroFields
protected boolean flat
protected boolean flatFreeText
protected int[] namePtr
protected HashSet partialFlattening
protected boolean useVp
protected PdfViewerPreferencesImp viewerPreferences
protected HashMap fieldTemplates
protected boolean fieldsAdded
protected int sigFlags
protected boolean append
protected IntHashtable marked
protected int initialXrefSize
protected PdfAction openAction
| Constructor Detail |
|---|
PdfStamperImp(PdfReader reader,
OutputStream os,
char pdfVersion,
boolean append)
throws DocumentException,
IOException
reader - the read PDFos - the output destinationpdfVersion - the new pdf version or '\0' to keep the same version as the original
documentappend -
DocumentException - on error
IOException| Method Detail |
|---|
void close(HashMap moreInfo)
throws IOException
IOException
void applyRotation(PdfDictionary pageN,
ByteBuffer out)
void alterContents()
throws IOException
IOExceptionvoid alterResources(PdfStamperImp.PageStamp ps)
protected int getNewObjectNumber(PdfReader reader,
int number,
int generation)
getNewObjectNumber in class PdfWriterRandomAccessFileOrArray getReaderFile(PdfReader reader)
getReaderFile in class PdfWriter
public void registerReader(PdfReader reader,
boolean openFile)
throws IOException
reader - openFile -
IOExceptionpublic void unRegisterReader(PdfReader reader)
reader -
static void findAllObjects(PdfReader reader,
PdfObject obj,
IntHashtable hits)
public void addComments(FdfReader fdf)
throws IOException
fdf -
IOExceptionPdfStamperImp.PageStamp getPageStamp(int pageNum)
PdfContentByte getUnderContent(int pageNum)
PdfContentByte getOverContent(int pageNum)
void correctAcroFieldPages(int page)
void insertPage(int pageNumber,
Rectangle mediabox)
boolean isRotateContents()
void setRotateContents(boolean rotateContents)
rotateContents - New value of property rotateContents.boolean isContentWritten()
AcroFields getAcroFields()
void setFormFlattening(boolean flat)
void setFreeTextFlattening(boolean flat)
boolean partialFormFlattening(String name)
void flatFields()
void eliminateAcroformObjects()
void sweepKids(PdfObject obj)
private void flatFreeTextFields()
public PdfIndirectReference getPageReference(int page)
PdfWriter
getPageReference in class PdfWriterpage - the page number. The first page is 1
PdfWriter.getPageReference(int)public void addAnnotation(PdfAnnotation annot)
PdfAnnotationsPdfAnnotation or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.
addAnnotation in interface PdfAnnotationsaddAnnotation in class PdfWriterannot - the PdfAnnotation or the PdfFormField to addPdfWriter.addAnnotation(com.lowagie.text.pdf.PdfAnnotation)void addDocumentField(PdfIndirectReference ref)
void addFieldResources()
throws IOException
IOException
void expandFields(PdfFormField field,
ArrayList allAnnots)
void addAnnotation(PdfAnnotation annot,
PdfDictionary pageN)
void addAnnotation(PdfAnnotation annot,
int page)
addAnnotation in class PdfWriterprivate void outlineTravel(PRIndirectReference outline)
void deleteOutlines()
void setJavaScript()
throws IOException
IOException
void addFileAttachments()
throws IOException
IOExceptionvoid makePackage(PdfCollection collection)
collection - the new collection dictionary.
void setOutlines()
throws IOException
IOExceptionpublic void setViewerPreferences(int preferences)
setViewerPreferences in interface PdfViewerPreferencessetViewerPreferences in class PdfWriterpreferences - the viewer preferencesPdfWriter.setViewerPreferences(int)
public void addViewerPreference(PdfName key,
PdfObject value)
addViewerPreference in interface PdfViewerPreferencesaddViewerPreference in class PdfWriterkey - a key for a viewer preferencevalue - the value for the viewer preferencePdfViewerPreferences.addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)public void setSigFlags(int f)
setSigFlags in interface PdfAnnotationssetSigFlags in class PdfWriterf - the flags. This flags are ORed with current onesPdfAnnotations.setSigFlags(int)
public void setPageAction(PdfName actionType,
PdfAction action)
throws PdfException
UnsupportedOperationException.
setPageAction in interface PdfPageActionssetPageAction in class PdfWriteractionType - ignoreaction - ignore
PdfException - ignorePdfStamper.setPageAction(PdfName, PdfAction, int)
void setPageAction(PdfName actionType,
PdfAction action,
int page)
throws PdfException
actionType - the action type. It can be PdfWriter.PAGE_OPEN
or PdfWriter.PAGE_CLOSEaction - the action to performpage - the page where the action will be applied. The first page is 1
PdfException - if the action type is invalidpublic void setDuration(int seconds)
UnsupportedOperationException.
setDuration in interface PdfPageActionssetDuration in class PdfWriterseconds - ignorePdfPageActions.setDuration(int)public void setTransition(PdfTransition transition)
UnsupportedOperationException.
setTransition in interface PdfPageActionssetTransition in class PdfWritertransition - ignorePdfPageActions.setTransition(com.lowagie.text.pdf.PdfTransition)
void setDuration(int seconds,
int page)
seconds - the number of seconds to display the page. A negative value removes the entrypage - the page where the duration will be applied. The first page is 1
void setTransition(PdfTransition transition,
int page)
transition - the transition object. A null removes the transitionpage - the page where the transition will be applied. The first page is 1protected void markUsed(PdfObject obj)
protected void markUsed(int num)
boolean isAppend()
public void setAdditionalAction(PdfName actionType,
PdfAction action)
throws PdfException
DOCUMENT_CLOSE,
WILL_SAVE, DID_SAVE, WILL_PRINT
and DID_PRINT.
setAdditionalAction in interface PdfDocumentActionssetAdditionalAction in class PdfWriteractionType - the action typeaction - the action to execute in response to the trigger
PdfException - on invalid action typePdfDocumentActions.setAdditionalAction(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfAction)public void setOpenAction(PdfAction action)
PdfDocumentActionsaction will be
invoked.
setOpenAction in interface PdfDocumentActionssetOpenAction in class PdfWriteraction - the action to be invokedPdfWriter.setOpenAction(com.lowagie.text.pdf.PdfAction)public void setOpenAction(String name)
PdfDocumentActions
setOpenAction in interface PdfDocumentActionssetOpenAction in class PdfWritername - the name of the destination to jump toPdfWriter.setOpenAction(java.lang.String)public void setThumbnail(Image image)
PdfWriter
setThumbnail in class PdfWriterimage - the imagePdfWriter.setThumbnail(com.lowagie.text.Image)
void setThumbnail(Image image,
int page)
throws PdfException,
DocumentException
PdfException
DocumentExceptionpublic PdfContentByte getDirectContentUnder()
PdfWriter
getDirectContentUnder in class PdfWriterpublic PdfContentByte getDirectContent()
PdfWriter
getDirectContent in class PdfWriter
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||