|
![]() |
||||||||
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()
|
private void |
addOrder(PdfLayer parent,
PdfArray arr,
Map ocgmap)
Recursive method to reconstruct the documentOCGorder variable in the writer. |
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)
|
Map |
getPdfLayers()
Gets the PdfLayer objects in an existing document as a Map with the names/titles of the layers as keys. |
(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 static void |
moveRectangle(PdfDictionary dic2,
PdfReader r,
int pageImported,
PdfName key,
String name)
|
private void |
outlineTravel(PRIndirectReference outline)
|
(package private) boolean |
partialFormFlattening(String name)
|
protected void |
readOCProperties()
Reads the OCProperties dictionary from the catalog of the existing document and fills the documentOCG, documentOCGorder and OCGRadioGroup variables in PdfWriter. |
void |
registerReader(PdfReader reader,
boolean openFile)
|
(package private) void |
replacePage(PdfReader r,
int pageImported,
int pageReplaced)
|
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, setMarginMirroringTopBottom, 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
IOException
void alterResources(PdfStamperImp.PageStamp ps)
protected int getNewObjectNumber(PdfReader reader, int number, int generation)
getNewObjectNumber
in class PdfWriter
RandomAccessFileOrArray getReaderFile(PdfReader reader)
getReaderFile
in class PdfWriter
public void registerReader(PdfReader reader, boolean openFile) throws IOException
reader
- openFile
-
IOException
public void unRegisterReader(PdfReader reader)
reader
- static void findAllObjects(PdfReader reader, PdfObject obj, IntHashtable hits)
public void addComments(FdfReader fdf) throws IOException
fdf
-
IOException
PdfStamperImp.PageStamp getPageStamp(int pageNum)
PdfContentByte getUnderContent(int pageNum)
PdfContentByte getOverContent(int pageNum)
void correctAcroFieldPages(int page)
private static void moveRectangle(PdfDictionary dic2, PdfReader r, int pageImported, PdfName key, String name)
void replacePage(PdfReader r, int pageImported, int pageReplaced)
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 PdfWriter
page
- the page number. The first page is 1
PdfWriter.getPageReference(int)
public void addAnnotation(PdfAnnotation annot)
PdfAnnotations
PdfAnnotation
or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.
addAnnotation
in interface PdfAnnotations
addAnnotation
in class PdfWriter
annot
- 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 PdfWriter
private void outlineTravel(PRIndirectReference outline)
void deleteOutlines()
void setJavaScript() throws IOException
IOException
void addFileAttachments() throws IOException
IOException
void makePackage(PdfCollection collection)
collection
- the new collection dictionary.void setOutlines() throws IOException
IOException
public void setViewerPreferences(int preferences)
setViewerPreferences
in interface PdfViewerPreferences
setViewerPreferences
in class PdfWriter
preferences
- the viewer preferencesPdfWriter.setViewerPreferences(int)
public void addViewerPreference(PdfName key, PdfObject value)
addViewerPreference
in interface PdfViewerPreferences
addViewerPreference
in class PdfWriter
key
- 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 PdfAnnotations
setSigFlags
in class PdfWriter
f
- the flags. This flags are ORed with current onesPdfAnnotations.setSigFlags(int)
public void setPageAction(PdfName actionType, PdfAction action) throws PdfException
UnsupportedOperationException
.
setPageAction
in interface PdfPageActions
setPageAction
in class PdfWriter
actionType
- 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_CLOSE
action
- 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 PdfPageActions
setDuration
in class PdfWriter
seconds
- ignorePdfPageActions.setDuration(int)
public void setTransition(PdfTransition transition)
UnsupportedOperationException
.
setTransition
in interface PdfPageActions
setTransition
in class PdfWriter
transition
- 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 1void 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 PdfDocumentActions
setAdditionalAction
in class PdfWriter
actionType
- 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)
PdfDocumentActions
action
will be
invoked.
setOpenAction
in interface PdfDocumentActions
setOpenAction
in class PdfWriter
action
- the action to be invokedPdfWriter.setOpenAction(com.lowagie.text.pdf.PdfAction)
public void setOpenAction(String name)
PdfDocumentActions
setOpenAction
in interface PdfDocumentActions
setOpenAction
in class PdfWriter
name
- the name of the destination to jump toPdfWriter.setOpenAction(java.lang.String)
public void setThumbnail(Image image)
PdfWriter
setThumbnail
in class PdfWriter
image
- the imagePdfWriter.setThumbnail(com.lowagie.text.Image)
void setThumbnail(Image image, int page) throws PdfException, DocumentException
PdfException
DocumentException
public PdfContentByte getDirectContentUnder()
PdfWriter
getDirectContentUnder
in class PdfWriter
public PdfContentByte getDirectContent()
PdfWriter
getDirectContent
in class PdfWriter
protected void readOCProperties()
private void addOrder(PdfLayer parent, PdfArray arr, Map ocgmap)
parent
- a parent PdfLayer (can be null)arr
- an array possibly containing children for the parent PdfLayerocgmap
- a HashMap with indirect reference Strings as keys and PdfLayer objects as values.public Map getPdfLayers()
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |