Java Doc for PdfWriter.java in  » PDF » pdf-itext » com » lowagie » text » pdf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » pdf itext » com.lowagie.text.pdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lowagie.text.DocWriter
      com.lowagie.text.pdf.PdfWriter

All known Subclasses:   com.lowagie.text.pdf.PdfCopyFieldsImp,  com.lowagie.text.pdf.PdfStamperImp,  com.lowagie.text.pdf.PdfCopy,
PdfWriter
public class PdfWriter extends DocWriter implements PdfViewerPreferences,PdfEncryptionSettings,PdfVersion,PdfDocumentActions,PdfPageActions,PdfXConformance,PdfRunDirection,PdfAnnotations(Code)
A DocWriter class for PDF.

When this PdfWriter is added to a certain PdfDocument, the PDF representation of every Element added to this Document will be written to the outputstream.


Inner Class :public static class PdfBody
Inner Class :static class PdfTrailer extends PdfDictionary

Field Summary
final public static  intAllowAssembly
    
final public static  intAllowCopy
    
final public static  intAllowDegradedPrinting
    
final public static  intAllowFillIn
    
final public static  intAllowModifyAnnotations
    
final public static  intAllowModifyContents
    
final public static  intAllowPrinting
    
final public static  intAllowScreenReaders
    
final public static  intCenterWindow
    
final public static  PdfNameDID_PRINT
    
final public static  PdfNameDID_SAVE
    
final public static  PdfNameDOCUMENT_CLOSE
    
final public static  intDO_NOT_ENCRYPT_METADATA
    
final public static  intDirectionL2R
    
final public static  intDirectionR2L
    
final public static  intDisplayDocTitle
    
final public static  intENCRYPTION_AES_128
    
final static  intENCRYPTION_MASK
     Mask to separate the encryption type from the encryption mode.
final public static  intFitWindow
    
final public static  intHideMenubar
    
final public static  intHideToolbar
    
final public static  intHideWindowUI
    
final public static  floatNO_SPACE_CHAR_RATIO
     Disable the inter-character spacing.
final public static  intNonFullScreenPageModeUseNone
    
final public static  intNonFullScreenPageModeUseOC
    
final public static  intNonFullScreenPageModeUseOutlines
    
final public static  intNonFullScreenPageModeUseThumbs
    
protected  PdfArrayOCGRadioGroup
    
protected  PdfOCPropertiesOCProperties
    
final public static  PdfNamePAGE_CLOSE
    
final public static  PdfNamePAGE_OPEN
    
final public static  intPDFA1A
     PDFA-1A level.
final public static  intPDFA1B
     PDFA-1B level.
final public static  intPDFX1A2001
     A PDF/X level.
final public static  intPDFX32002
     A PDF/X level.
final public static  intPDFXNONE
     A PDF/X level.
final public static  PdfNamePDF_VERSION_1_2
    
final public static  PdfNamePDF_VERSION_1_3
    
final public static  PdfNamePDF_VERSION_1_4
    
final public static  PdfNamePDF_VERSION_1_5
    
final public static  PdfNamePDF_VERSION_1_6
    
final public static  PdfNamePDF_VERSION_1_7
    
final public static  intPageLayoutOneColumn
    
final public static  intPageLayoutSinglePage
    
final public static  intPageLayoutTwoColumnLeft
    
final public static  intPageLayoutTwoColumnRight
    
final public static  intPageLayoutTwoPageLeft
    
final public static  intPageLayoutTwoPageRight
    
final public static  intPageModeFullScreen
    
final public static  intPageModeUseAttachments
    
final public static  intPageModeUseNone
    
final public static  intPageModeUseOC
    
final public static  intPageModeUseOutlines
    
final public static  intPageModeUseThumbs
    
final public static  intPrintScalingNone
    
final public static  intRUN_DIRECTION_DEFAULT
     Use the default run direction.
final public static  intRUN_DIRECTION_LTR
     Use bidirectional reordering with left-to-right preferential run direction.
final public static  intRUN_DIRECTION_NO_BIDI
     Do not use bidirectional reordering.
final public static  intRUN_DIRECTION_RTL
     Use bidirectional reordering with right-to-left preferential run direction.
final public static  intSIGNATURE_APPEND_ONLY
    
final public static  intSIGNATURE_EXISTS
    
final public static  floatSPACE_CHAR_RATIO_DEFAULT
     The default space-char ratio.
final public static  intSTANDARD_ENCRYPTION_128
    
final public static  intSTANDARD_ENCRYPTION_40
    
final public static  booleanSTRENGTH128BITS
    
final public static  booleanSTRENGTH40BITS
    
final public static  charVERSION_1_2
    
final public static  charVERSION_1_3
    
final public static  charVERSION_1_4
    
final public static  charVERSION_1_5
    
final public static  charVERSION_1_6
    
final public static  charVERSION_1_7
    
final public static  PdfNameWILL_PRINT
    
final public static  PdfNameWILL_SAVE
    
protected  PdfBodybody
    
protected  intcolorNumber
     The color number counter for the colors in the document.
protected  PdfEncryptioncrypto
     Contains the business logic for cryptography.
protected  intcurrentPageNumber
     The current page number.
protected  PdfReaderInstancecurrentPdfReaderInstance
    
protected  PdfDictionarydefaultColorspace
    
protected  PdfContentBytedirectContent
     The direct content in this document.
protected  PdfContentBytedirectContentUnder
     The direct content under in this document.
protected  HashMapdocumentColors
    
protected  HashMapdocumentExtGState
    
protected  HashMapdocumentFonts
    
protected  HashSetdocumentOCG
    
protected  ArrayListdocumentOCGorder
    
protected  HashMapdocumentPatterns
    
protected  HashMapdocumentProperties
    
protected  HashMapdocumentShadingPatterns
    
protected  HashMapdocumentShadings
    
protected  HashMapdocumentSpotPatterns
    
protected  PdfDictionaryextraCatalog
     Holds value of property extraCatalog this is used for Output Intents.
protected  intfontNumber
     The font number counter for the fonts in the document.
protected  HashMapformXObjects
     The form XObjects in this document.
protected  intformXObjectsCounter
     The name counter for the form XObjects name.
protected  booleanfullCompression
     Holds value of property fullCompression.
protected  PdfDictionarygroup
    
protected  PdfDictionaryimageDictionary
    
protected  HashMapimportedPages
    
protected  java.util.ListnewBookmarks
    
protected  ArrayListpageReferences
     The PdfIndirectReference to the pages.
protected  ColorDetailspatternColorspaceCMYK
    
protected  ColorDetailspatternColorspaceGRAY
    
protected  ColorDetailspatternColorspaceRGB
    
protected  intpatternNumber
     The patten number counter for the colors in the document.
protected  PdfDocumentpdf
     the pdfdocument object.
protected  PdfVersionImppdf_version
     Stores the version information for the header and the catalog.
protected  intprevxref
     A number refering to the previous Cross-Reference Table.
protected  PdfPagesroot
     The root of the page tree.
protected  intrunDirection
    
protected  PdfStructureTreeRootstructureTreeRoot
    
protected  booleantagged
    
protected  floatuserunit
    
protected  byte[]xmpMetadata
     XMP Metadata for the document.

Constructor Summary
protected  PdfWriter()
     Constructs a PdfWriter.
protected  PdfWriter(PdfDocument document, OutputStream os)
     Constructs a PdfWriter.

Method Summary
 PdfIndirectReferenceadd(PdfPage page, PdfContents contents)
     Adds some PdfContents to this Writer.
 PdfIndirectReferenceadd(PdfImage pdfImage, PdfIndirectReference fixedRef)
     Writes a PdfImage to the outputstream.
protected  PdfIndirectReferenceadd(PdfICCBased icc)
    
public  voidaddAnnotation(PdfAnnotation annot)
    
 voidaddAnnotation(PdfAnnotation annot, int page)
    
public  voidaddCalculationOrder(PdfFormField annot)
    
public  PdfNameaddDirectImageSimple(Image image)
     Use this method to adds an image to the document but not to the page resources.
public  PdfNameaddDirectImageSimple(Image image, PdfIndirectReference fixedRef)
     Adds an image to the document but not to the page resources. It is used with templates and Document.add(Image). Use this method only if you know what you're doing!
Parameters:
  image - the Image to add
Parameters:
  fixedRef - the reference to used.
 PdfNameaddDirectTemplateSimple(PdfTemplate template, PdfName forcedName)
     Adds a template to the document but not to the page resources.
Parameters:
  template - the template to add
Parameters:
  forcedName - the template name, rather than a generated one.
public  voidaddFileAttachment(String description, byte fileStore, String file, String fileDisplay)
     Use this method to add a file attachment at the document level.
Parameters:
  description - the file description
Parameters:
  fileStore - an array with the file.
public  voidaddFileAttachment(String description, PdfFileSpecification fs)
     Use this method to add a file attachment at the document level.
public  voidaddFileAttachment(PdfFileSpecification fs)
     Use this method to add a file attachment at the document level.
public  voidaddJavaScript(PdfAction js)
     Use this method to add a JavaScript action at the document level.
public  voidaddJavaScript(String code, boolean unicode)
     Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  code - the JavaScript code
Parameters:
  unicode - select JavaScript unicode.
public  voidaddJavaScript(String code)
     Use this method to adds a JavaScript action at the document level.
public  voidaddJavaScript(String name, PdfAction js)
     Use this method to add a JavaScript action at the document level.
public  voidaddJavaScript(String name, String code, boolean unicode)
     Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  name - The name of the JS Action in the name tree
Parameters:
  code - the JavaScript code
Parameters:
  unicode - select JavaScript unicode.
public  voidaddJavaScript(String name, String code)
     Use this method to adds a JavaScript action at the document level.
 voidaddLocalDestinations(TreeMap dest)
     Adds the local destinations to the body of the document.
public  voidaddOCGRadioGroup(ArrayList group)
     Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm.
protected  voidaddSharedObjectsToBody()
    
 FontDetailsaddSimple(BaseFont bf)
     Adds a BaseFont to the document but not to the page resources.
 ColorDetailsaddSimple(PdfSpotColor spc)
     Adds a SpotColor to the document but not to the page resources.
 PdfObject[]addSimpleExtGState(PdfDictionary gstate)
    
 PdfNameaddSimplePattern(PdfPatternPainter painter)
    
 ColorDetailsaddSimplePatternColorspace(Color color)
    
 PdfObject[]addSimpleProperty(Object prop, PdfIndirectReference refi)
    
 voidaddSimpleShading(PdfShading shading)
    
 voidaddSimpleShadingPattern(PdfShadingPattern shading)
    
public  PdfIndirectObjectaddToBody(PdfObject object)
     Use this method to add a PDF object to the PDF body.
public  PdfIndirectObjectaddToBody(PdfObject object, boolean inObjStm)
     Use this method to add a PDF object to the PDF body.
public  PdfIndirectObjectaddToBody(PdfObject object, PdfIndirectReference ref)
     Use this method to add a PDF object to the PDF body.
public  PdfIndirectObjectaddToBody(PdfObject object, PdfIndirectReference ref, boolean inObjStm)
     Use this method to add a PDF object to the PDF body.
public  PdfIndirectObjectaddToBody(PdfObject object, int refNumber)
     Use this method to add a PDF object to the PDF body.
public  PdfIndirectObjectaddToBody(PdfObject object, int refNumber, boolean inObjStm)
     Use this method to add a PDF object to the PDF body.
public  voidaddViewerPreference(PdfName key, PdfObject value)
    
public  booleanbreakTableIfDoesntFit(PdfTable table)
     Row additions to the original Table used to build the PdfTable are processed and pre-rendered, and then the contents are deleted.
public  voidclearTextWrap()
     Use this method to clear text wrapping around images (if applicable).
public  voidclose()
     Signals that the Document was closed and that no other Elements will be added.
public  voidcreateXmpMetadata()
     Use this method to creates XMP Metadata based on the metadata in the PdfDocument.
 voideliminateFontSubset(PdfDictionary fonts)
    
public  booleanfitsPage(Table table, float margin)
     Checks if a Table fits the current page of the PdfDocument.
public  booleanfitsPage(Table table)
     Checks if a Table fits the current page of the PdfDocument.
public  booleanfitsPage(PdfPTable table, float margin)
     Checks if a PdfPTable fits the current page of the PdfDocument.
public  booleanfitsPage(PdfPTable table)
     Checks if a PdfPTable fits the current page of the PdfDocument.
public  voidfreeReader(PdfReader reader)
     Use this method to writes the reader to the document and free the memory used by it.
public  PdfAcroFormgetAcroForm()
    
public  RectanglegetBoxSize(String boxName)
     Use this method to get the size of a trim, art, crop or bleed box, or null if not defined.
protected  PdfDictionarygetCatalog(PdfIndirectReference rootObj)
    
 PdfNamegetColorspaceName()
    
public  intgetCurrentDocumentSize()
     Use this method to gets the current document size.
 PdfIndirectReferencegetCurrentPage()
    
public  intgetCurrentPageNumber()
    
public  PdfDictionarygetDefaultColorspace()
     Use this method to get the default colorspaces.
public  PdfContentBytegetDirectContent()
     Use this method to get the direct content for this document.
public  PdfContentBytegetDirectContentUnder()
     Use this method to get the direct content under for this document.
 PdfEncryptiongetEncryption()
    
public  PdfDictionarygetExtraCatalog()
     Sets extra keys to the catalog.
public  PdfDictionarygetGroup()
     Use this method to get the group dictionary.
 PdfIndirectReferencegetImageReference(PdfName name)
     return the PdfIndirectReference to the image with a given name.
public  PdfImportedPagegetImportedPage(PdfReader reader, int pageNumber)
     Use this method to get a page from other PDF document. The page can be used as any other PdfTemplate. Note that calling this method more than once with the same parameters will retrieve the same object.
Parameters:
  reader - the PDF document where the page is
Parameters:
  pageNumber - the page number.
 intgetIndirectReferenceNumber()
    
public  PdfDictionarygetInfo()
     Use this method to get the info dictionary if you want to change it directly (add keys and values to the info dictionary).
public static  PdfWritergetInstance(Document document, OutputStream os)
     Use this method to get an instance of the PdfWriter.
public static  PdfWritergetInstance(Document document, OutputStream os, DocListener listener)
     Use this method to get an instance of the PdfWriter.
protected  intgetNewObjectNumber(PdfReader reader, int number, int generation)
    
public  PdfOCPropertiesgetOCProperties()
     Use this method to get the Optional Content Properties Dictionary.
 OutputStreamCountergetOs()
     Returns the outputStreamCounter.
public  intgetPDFXConformance()
    
public  PdfPageEventgetPageEvent()
     Gets the PdfPageEvent for this document or null if none is set.
public  intgetPageNumber()
     Gets the pagenumber of this document.
public  PdfIndirectReferencegetPageReference(int page)
     Use this method to get a reference to a page existing or not. If the page does not exist yet the reference will be created in advance.
public  RectanglegetPageSize()
     Use this method to get the size of the media box.
 PdfDocumentgetPdfDocument()
     Gets the PdfDocument associated with this writer.
public  PdfIndirectReferencegetPdfIndirectReference()
     Use this to get an PdfIndirectReference for an object that will be created in the future.
public  PdfTablegetPdfTable(Table table)
     Gets a pre-rendered table. (Contributed by dperezcar@fcc.es)
Parameters:
  table - Contains the table definition.
 PdfVersionImpgetPdfVersion()
     Returns the version information.
 RandomAccessFileOrArraygetReaderFile(PdfReader reader)
    
public  PdfOutlinegetRootOutline()
     Use this method to get the root outline and construct bookmarks.
public  intgetRunDirection()
     Use this method to set the run direction.
public  floatgetSpaceCharRatio()
     Use this method to gets the space/character extra spacing ratio for fully justified text.
public  PdfStructureTreeRootgetStructureTreeRoot()
     Gets the structure tree root.
public  floatgetTableBottom(Table table)
     Sometimes it is necessary to know where the just added Table ends.
public  floatgetUserunit()
     Use this method to get the user unit.
public  floatgetVerticalPosition(boolean ensureNewLine)
     Use this method to get the current vertical page position.
Parameters:
  ensureNewLine - Tells whether a new line shall be enforced.
public  booleanisFullCompression()
     Use this method to find out if 1.5 compression is on.
public  booleanisPdfX()
    
public  booleanisStrictImageSequence()
     Use this method to get the strictImageSequence status.
public  booleanisTagged()
     Check if the document is marked for tagging.
public  booleanisUserProperties()
     Gets the flag indicating the presence of structure elements that contain user properties attributes.
public  voidopen()
     Signals that the Document has been opened and that Elements can be added.
 booleanpropertyExists(Object prop)
    
 voidregisterLayer(PdfOCG layer)
    
public  voidreleaseTemplate(PdfTemplate tp)
     Use this method to releases the memory used by a template.
public  intreorderPages(int order)
     Use this method to reorder the pages in the document. A null argument value only returns the number of pages to process. It is advisable to issue a Document.newPage() before using this method. the total number of pages
Parameters:
  order - an array with the new page sequence.
 voidresetContent()
     Resets all the direct contents to empty.
public  voidsetAdditionalAction(PdfName actionType, PdfAction action)
    
public  voidsetAtLeastPdfVersion(char version)
    
public  voidsetBoxSize(String boxName, Rectangle size)
     Use this method to set the page box sizes.
public  voidsetCollection(PdfCollection collection)
     Use this method to add the Collection dictionary.
public  voidsetCropBoxSize(Rectangle crop)
     Use this method to set the crop box.
public  voidsetDefaultColorspace(PdfName key, PdfObject cs)
     Use this method to sets the default colorspace that will be applied to all the document.
public  voidsetDuration(int seconds)
    
public  voidsetEncryption(byte userPassword, byte ownerPassword, int permissions, int encryptionType)
    
public  voidsetEncryption(Certificate[] certs, int[] permissions, int encryptionType)
    
public  voidsetEncryption(byte userPassword, byte ownerPassword, int permissions, boolean strength128Bits)
     Sets the encryption options for this document.
public  voidsetEncryption(boolean strength, String userPassword, String ownerPassword, int permissions)
     Sets the encryption options for this document.
public  voidsetEncryption(int encryptionType, String userPassword, String ownerPassword, int permissions)
     Sets the encryption options for this document.
public  voidsetFullCompression()
     Use this method to set the document's compression to the PDF 1.5 mode with object streams and xref streams.
public  voidsetGroup(PdfDictionary group)
     Use this method to set the group dictionary.
public  voidsetLinearPageMode()
     Use this method to make sure the page tree has a lineair structure (every leave is attached directly to the root).
public  voidsetOpenAction(String name)
    
public  voidsetOpenAction(PdfAction action)
    
public  voidsetOutlines(java.util.List outlines)
     Sets the bookmarks.
public  voidsetOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, byte destOutputProfile)
     Use this method to set the values of the output intent dictionary.
public  booleansetOutputIntents(PdfReader reader, boolean checkExistence)
     Use this method to copy the output intent dictionary from another document to this one.
public  voidsetPDFXConformance(int pdfx)
    
public  voidsetPageAction(PdfName actionType, PdfAction action)
    
public  voidsetPageEmpty(boolean pageEmpty)
     Use this method to make sure a page is added, even if it's empty.
public  voidsetPageEvent(PdfPageEvent event)
     Sets the PdfPageEvent for this document.
public  voidsetPageLabels(PdfPageLabels pageLabels)
    
public  voidsetPageXmpMetadata(byte[] xmpMetadata)
     Use this method to set the XMP Metadata for each page.
public  voidsetPdfVersion(char version)
    
public  voidsetPdfVersion(PdfName version)
    
public  voidsetRunDirection(int runDirection)
     Use this method to set the run direction.
public  voidsetSigFlags(int f)
    
public  voidsetSpaceCharRatio(float spaceCharRatio)
     Use this method to set the ratio between the extra word spacing and the extra character spacing when the text is fully justified. Extra word spacing will grow spaceCharRatio times more than extra character spacing.
public  voidsetStrictImageSequence(boolean strictImageSequence)
     Use this method to set the image sequence, so that it follows the text in strict order (or not).
public  voidsetTagged()
     Mark this document for tagging.
public  voidsetThumbnail(Image image)
     Use this method to set the thumbnail image for the current page.
public  voidsetTransition(PdfTransition transition)
    
public  voidsetUserProperties(boolean userProperties)
     Sets the flag indicating the presence of structure elements that contain user properties attributes.
public  voidsetUserunit(float userunit)
     Use this method to set the user unit.
public  voidsetViewerPreferences(int preferences)
    
public  voidsetXmpMetadata(byte[] xmpMetadata)
     Use this method to set the XMP Metadata.
protected  voidwriteOutlines(PdfDictionary catalog, boolean namedAsNames)
    

Field Detail
AllowAssembly
final public static int AllowAssembly(Code)
The operation permitted when the document is opened with the user password



AllowCopy
final public static int AllowCopy(Code)
The operation permitted when the document is opened with the user password



AllowDegradedPrinting
final public static int AllowDegradedPrinting(Code)
The operation permitted when the document is opened with the user password



AllowFillIn
final public static int AllowFillIn(Code)
The operation permitted when the document is opened with the user password



AllowModifyAnnotations
final public static int AllowModifyAnnotations(Code)
The operation permitted when the document is opened with the user password



AllowModifyContents
final public static int AllowModifyContents(Code)
The operation permitted when the document is opened with the user password



AllowPrinting
final public static int AllowPrinting(Code)
The operation permitted when the document is opened with the user password



AllowScreenReaders
final public static int AllowScreenReaders(Code)
The operation permitted when the document is opened with the user password



CenterWindow
final public static int CenterWindow(Code)
A viewer preference



DID_PRINT
final public static PdfName DID_PRINT(Code)
action value



DID_SAVE
final public static PdfName DID_SAVE(Code)
action value



DOCUMENT_CLOSE
final public static PdfName DOCUMENT_CLOSE(Code)
action value



DO_NOT_ENCRYPT_METADATA
final public static int DO_NOT_ENCRYPT_METADATA(Code)
Add this to the mode to keep the metadata in clear text



DirectionL2R
final public static int DirectionL2R(Code)
A viewer preference



DirectionR2L
final public static int DirectionR2L(Code)
A viewer preference



DisplayDocTitle
final public static int DisplayDocTitle(Code)
A viewer preference



ENCRYPTION_AES_128
final public static int ENCRYPTION_AES_128(Code)
Type of encryption



ENCRYPTION_MASK
final static int ENCRYPTION_MASK(Code)
Mask to separate the encryption type from the encryption mode.



FitWindow
final public static int FitWindow(Code)
A viewer preference



HideMenubar
final public static int HideMenubar(Code)
A viewer preference



HideToolbar
final public static int HideToolbar(Code)
A viewer preference



HideWindowUI
final public static int HideWindowUI(Code)
A viewer preference



NO_SPACE_CHAR_RATIO
final public static float NO_SPACE_CHAR_RATIO(Code)
Disable the inter-character spacing.



NonFullScreenPageModeUseNone
final public static int NonFullScreenPageModeUseNone(Code)
A viewer preference



NonFullScreenPageModeUseOC
final public static int NonFullScreenPageModeUseOC(Code)
A viewer preference



NonFullScreenPageModeUseOutlines
final public static int NonFullScreenPageModeUseOutlines(Code)
A viewer preference



NonFullScreenPageModeUseThumbs
final public static int NonFullScreenPageModeUseThumbs(Code)
A viewer preference



OCGRadioGroup
protected PdfArray OCGRadioGroup(Code)



OCProperties
protected PdfOCProperties OCProperties(Code)



PAGE_CLOSE
final public static PdfName PAGE_CLOSE(Code)
action value



PAGE_OPEN
final public static PdfName PAGE_OPEN(Code)
action value



PDFA1A
final public static int PDFA1A(Code)
PDFA-1A level.



PDFA1B
final public static int PDFA1B(Code)
PDFA-1B level.



PDFX1A2001
final public static int PDFX1A2001(Code)
A PDF/X level.



PDFX32002
final public static int PDFX32002(Code)
A PDF/X level.



PDFXNONE
final public static int PDFXNONE(Code)
A PDF/X level.



PDF_VERSION_1_2
final public static PdfName PDF_VERSION_1_2(Code)
possible PDF version (catalog)



PDF_VERSION_1_3
final public static PdfName PDF_VERSION_1_3(Code)
possible PDF version (catalog)



PDF_VERSION_1_4
final public static PdfName PDF_VERSION_1_4(Code)
possible PDF version (catalog)



PDF_VERSION_1_5
final public static PdfName PDF_VERSION_1_5(Code)
possible PDF version (catalog)



PDF_VERSION_1_6
final public static PdfName PDF_VERSION_1_6(Code)
possible PDF version (catalog)



PDF_VERSION_1_7
final public static PdfName PDF_VERSION_1_7(Code)
possible PDF version (catalog)



PageLayoutOneColumn
final public static int PageLayoutOneColumn(Code)
A viewer preference



PageLayoutSinglePage
final public static int PageLayoutSinglePage(Code)
A viewer preference



PageLayoutTwoColumnLeft
final public static int PageLayoutTwoColumnLeft(Code)
A viewer preference



PageLayoutTwoColumnRight
final public static int PageLayoutTwoColumnRight(Code)
A viewer preference



PageLayoutTwoPageLeft
final public static int PageLayoutTwoPageLeft(Code)
A viewer preference



PageLayoutTwoPageRight
final public static int PageLayoutTwoPageRight(Code)
A viewer preference



PageModeFullScreen
final public static int PageModeFullScreen(Code)
A viewer preference



PageModeUseAttachments
final public static int PageModeUseAttachments(Code)
A viewer preference



PageModeUseNone
final public static int PageModeUseNone(Code)
A viewer preference



PageModeUseOC
final public static int PageModeUseOC(Code)
A viewer preference



PageModeUseOutlines
final public static int PageModeUseOutlines(Code)
A viewer preference



PageModeUseThumbs
final public static int PageModeUseThumbs(Code)
A viewer preference



PrintScalingNone
final public static int PrintScalingNone(Code)
A viewer preference



RUN_DIRECTION_DEFAULT
final public static int RUN_DIRECTION_DEFAULT(Code)
Use the default run direction.



RUN_DIRECTION_LTR
final public static int RUN_DIRECTION_LTR(Code)
Use bidirectional reordering with left-to-right preferential run direction.



RUN_DIRECTION_NO_BIDI
final public static int RUN_DIRECTION_NO_BIDI(Code)
Do not use bidirectional reordering.



RUN_DIRECTION_RTL
final public static int RUN_DIRECTION_RTL(Code)
Use bidirectional reordering with right-to-left preferential run direction.



SIGNATURE_APPEND_ONLY
final public static int SIGNATURE_APPEND_ONLY(Code)
signature value



SIGNATURE_EXISTS
final public static int SIGNATURE_EXISTS(Code)
signature value



SPACE_CHAR_RATIO_DEFAULT
final public static float SPACE_CHAR_RATIO_DEFAULT(Code)
The default space-char ratio.



STANDARD_ENCRYPTION_128
final public static int STANDARD_ENCRYPTION_128(Code)
Type of encryption



STANDARD_ENCRYPTION_40
final public static int STANDARD_ENCRYPTION_40(Code)
Type of encryption



STRENGTH128BITS
final public static boolean STRENGTH128BITS(Code)
Type of standard encryption strength



STRENGTH40BITS
final public static boolean STRENGTH40BITS(Code)
Type of standard encryption strength



VERSION_1_2
final public static char VERSION_1_2(Code)
possible PDF version (header)



VERSION_1_3
final public static char VERSION_1_3(Code)
possible PDF version (header)



VERSION_1_4
final public static char VERSION_1_4(Code)
possible PDF version (header)



VERSION_1_5
final public static char VERSION_1_5(Code)
possible PDF version (header)



VERSION_1_6
final public static char VERSION_1_6(Code)
possible PDF version (header)



VERSION_1_7
final public static char VERSION_1_7(Code)
possible PDF version (header)



WILL_PRINT
final public static PdfName WILL_PRINT(Code)
action value



WILL_SAVE
final public static PdfName WILL_SAVE(Code)
action value



body
protected PdfBody body(Code)
body of the PDF document



colorNumber
protected int colorNumber(Code)
The color number counter for the colors in the document.



crypto
protected PdfEncryption crypto(Code)
Contains the business logic for cryptography.



currentPageNumber
protected int currentPageNumber(Code)
The current page number.



currentPdfReaderInstance
protected PdfReaderInstance currentPdfReaderInstance(Code)



defaultColorspace
protected PdfDictionary defaultColorspace(Code)



directContent
protected PdfContentByte directContent(Code)
The direct content in this document.



directContentUnder
protected PdfContentByte directContentUnder(Code)
The direct content under in this document.



documentColors
protected HashMap documentColors(Code)
The colors of this document



documentExtGState
protected HashMap documentExtGState(Code)



documentFonts
protected HashMap documentFonts(Code)
The fonts of this document



documentOCG
protected HashSet documentOCG(Code)



documentOCGorder
protected ArrayList documentOCGorder(Code)



documentPatterns
protected HashMap documentPatterns(Code)
The patterns of this document



documentProperties
protected HashMap documentProperties(Code)



documentShadingPatterns
protected HashMap documentShadingPatterns(Code)



documentShadings
protected HashMap documentShadings(Code)



documentSpotPatterns
protected HashMap documentSpotPatterns(Code)



extraCatalog
protected PdfDictionary extraCatalog(Code)
Holds value of property extraCatalog this is used for Output Intents.



fontNumber
protected int fontNumber(Code)
The font number counter for the fonts in the document.



formXObjects
protected HashMap formXObjects(Code)
The form XObjects in this document. The key is the xref and the value is Object[]{PdfName, template}.



formXObjectsCounter
protected int formXObjectsCounter(Code)
The name counter for the form XObjects name.



fullCompression
protected boolean fullCompression(Code)
Holds value of property fullCompression.



group
protected PdfDictionary group(Code)
A group attributes dictionary specifying the attributes of the page's page group for use in the transparent imaging model



imageDictionary
protected PdfDictionary imageDictionary(Code)
Dictionary, containing all the images of the PDF document



importedPages
protected HashMap importedPages(Code)



newBookmarks
protected java.util.List newBookmarks(Code)



pageReferences
protected ArrayList pageReferences(Code)
The PdfIndirectReference to the pages.



patternColorspaceCMYK
protected ColorDetails patternColorspaceCMYK(Code)



patternColorspaceGRAY
protected ColorDetails patternColorspaceGRAY(Code)



patternColorspaceRGB
protected ColorDetails patternColorspaceRGB(Code)



patternNumber
protected int patternNumber(Code)
The patten number counter for the colors in the document.



pdf
protected PdfDocument pdf(Code)
the pdfdocument object.



pdf_version
protected PdfVersionImp pdf_version(Code)
Stores the version information for the header and the catalog.



prevxref
protected int prevxref(Code)
A number refering to the previous Cross-Reference Table.



root
protected PdfPages root(Code)
The root of the page tree.



runDirection
protected int runDirection(Code)



structureTreeRoot
protected PdfStructureTreeRoot structureTreeRoot(Code)



tagged
protected boolean tagged(Code)



userunit
protected float userunit(Code)



xmpMetadata
protected byte[] xmpMetadata(Code)
XMP Metadata for the document.




Constructor Detail
PdfWriter
protected PdfWriter()(Code)
Constructs a PdfWriter.



PdfWriter
protected PdfWriter(PdfDocument document, OutputStream os)(Code)
Constructs a PdfWriter.

Remark: a PdfWriter can only be constructed by calling the method getInstance(Document document, OutputStream os).
Parameters:
  document - The PdfDocument that has to be written
Parameters:
  os - The OutputStream the writer has to write to.





Method Detail
add
PdfIndirectReference add(PdfPage page, PdfContents contents) throws PdfException(Code)
Adds some PdfContents to this Writer.

The document has to be open before you can begin to add content to the body of the document. a PdfIndirectReference
Parameters:
  page - the PdfPage to add
Parameters:
  contents - the PdfContents of the page
throws:
  PdfException - on error




add
PdfIndirectReference add(PdfImage pdfImage, PdfIndirectReference fixedRef) throws PdfException(Code)
Writes a PdfImage to the outputstream.
Parameters:
  pdfImage - the image to be added a PdfIndirectReference to the encapsulated image
throws:
  PdfException - when a document isn't open yet, or has been closed



add
protected PdfIndirectReference add(PdfICCBased icc)(Code)



addAnnotation
public void addAnnotation(PdfAnnotation annot)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfAnnotations.addAnnotation(com.lowagie.text.pdf.PdfAnnotation)
See Also:   



addAnnotation
void addAnnotation(PdfAnnotation annot, int page)(Code)



addCalculationOrder
public void addCalculationOrder(PdfFormField annot)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfAnnotations.addCalculationOrder(com.lowagie.text.pdf.PdfFormField)
See Also:   



addDirectImageSimple
public PdfName addDirectImageSimple(Image image) throws PdfException, DocumentException(Code)
Use this method to adds an image to the document but not to the page resources. It is used with templates and Document.add(Image). Use this method only if you know what you're doing!
Parameters:
  image - the Image to add the name of the image added
throws:
  PdfException - on error
throws:
  DocumentException - on error



addDirectImageSimple
public PdfName addDirectImageSimple(Image image, PdfIndirectReference fixedRef) throws PdfException, DocumentException(Code)
Adds an image to the document but not to the page resources. It is used with templates and Document.add(Image). Use this method only if you know what you're doing!
Parameters:
  image - the Image to add
Parameters:
  fixedRef - the reference to used. It may be null,a PdfIndirectReference or a PRIndirectReference. the name of the image added
throws:
  PdfException - on error
throws:
  DocumentException - on error



addDirectTemplateSimple
PdfName addDirectTemplateSimple(PdfTemplate template, PdfName forcedName)(Code)
Adds a template to the document but not to the page resources.
Parameters:
  template - the template to add
Parameters:
  forcedName - the template name, rather than a generated one. Can be null the PdfName for this template



addFileAttachment
public void addFileAttachment(String description, byte fileStore, String file, String fileDisplay) throws IOException(Code)
Use this method to add a file attachment at the document level.
Parameters:
  description - the file description
Parameters:
  fileStore - an array with the file. If it's nullthe file will be read from the disk
Parameters:
  file - the path to the file. It will only be used iffileStore is not null
Parameters:
  fileDisplay - the actual file name stored in the pdf
throws:
  IOException - on error



addFileAttachment
public void addFileAttachment(String description, PdfFileSpecification fs) throws IOException(Code)
Use this method to add a file attachment at the document level.
Parameters:
  description - the file description
Parameters:
  fs - the file specification



addFileAttachment
public void addFileAttachment(PdfFileSpecification fs) throws IOException(Code)
Use this method to add a file attachment at the document level.
Parameters:
  fs - the file specification



addJavaScript
public void addJavaScript(PdfAction js)(Code)
Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  js - The JavaScript action



addJavaScript
public void addJavaScript(String code, boolean unicode)(Code)
Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  code - the JavaScript code
Parameters:
  unicode - select JavaScript unicode. Note that the internalAcrobat JavaScript engine does not support unicode,so this may or may not work for you



addJavaScript
public void addJavaScript(String code)(Code)
Use this method to adds a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  code - the JavaScript code



addJavaScript
public void addJavaScript(String name, PdfAction js)(Code)
Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  name - The name of the JS Action in the name tree
Parameters:
  js - The JavaScript action



addJavaScript
public void addJavaScript(String name, String code, boolean unicode)(Code)
Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  name - The name of the JS Action in the name tree
Parameters:
  code - the JavaScript code
Parameters:
  unicode - select JavaScript unicode. Note that the internalAcrobat JavaScript engine does not support unicode,so this may or may not work for you



addJavaScript
public void addJavaScript(String name, String code)(Code)
Use this method to adds a JavaScript action at the document level. When the document opens, all this JavaScript runs.
Parameters:
  name - The name of the JS Action in the name tree
Parameters:
  code - the JavaScript code



addLocalDestinations
void addLocalDestinations(TreeMap dest) throws IOException(Code)
Adds the local destinations to the body of the document.
Parameters:
  dest - the HashMap containing the destinations
throws:
  IOException - on error



addOCGRadioGroup
public void addOCGRadioGroup(ArrayList group)(Code)
Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm. That is, the state of at most one optional content group in the array should be ON at a time: if one group is turned ON, all others must be turned OFF.
Parameters:
  group - the radio group



addSharedObjectsToBody
protected void addSharedObjectsToBody() throws IOException(Code)



addSimple
FontDetails addSimple(BaseFont bf)(Code)
Adds a BaseFont to the document but not to the page resources. It is used for templates.
Parameters:
  bf - the BaseFont to add an Object[] where position 0 is a PdfNameand position 1 is an PdfIndirectReference



addSimple
ColorDetails addSimple(PdfSpotColor spc)(Code)
Adds a SpotColor to the document but not to the page resources.
Parameters:
  spc - the SpotColor to add an Object[] where position 0 is a PdfNameand position 1 is an PdfIndirectReference



addSimpleExtGState
PdfObject[] addSimpleExtGState(PdfDictionary gstate)(Code)



addSimplePattern
PdfName addSimplePattern(PdfPatternPainter painter)(Code)



addSimplePatternColorspace
ColorDetails addSimplePatternColorspace(Color color)(Code)



addSimpleProperty
PdfObject[] addSimpleProperty(Object prop, PdfIndirectReference refi)(Code)



addSimpleShading
void addSimpleShading(PdfShading shading)(Code)



addSimpleShadingPattern
void addSimpleShadingPattern(PdfShadingPattern shading)(Code)



addToBody
public PdfIndirectObject addToBody(PdfObject object) throws IOException(Code)
Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing!
Parameters:
  object - a PdfIndirectObject
throws:
  IOException -



addToBody
public PdfIndirectObject addToBody(PdfObject object, boolean inObjStm) throws IOException(Code)
Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing!
Parameters:
  object -
Parameters:
  inObjStm - a PdfIndirectObject
throws:
  IOException -



addToBody
public PdfIndirectObject addToBody(PdfObject object, PdfIndirectReference ref) throws IOException(Code)
Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing!
Parameters:
  object -
Parameters:
  ref - a PdfIndirectObject
throws:
  IOException -



addToBody
public PdfIndirectObject addToBody(PdfObject object, PdfIndirectReference ref, boolean inObjStm) throws IOException(Code)
Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing!
Parameters:
  object -
Parameters:
  ref -
Parameters:
  inObjStm - a PdfIndirectObject
throws:
  IOException -



addToBody
public PdfIndirectObject addToBody(PdfObject object, int refNumber) throws IOException(Code)
Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing!
Parameters:
  object -
Parameters:
  refNumber - a PdfIndirectObject
throws:
  IOException -



addToBody
public PdfIndirectObject addToBody(PdfObject object, int refNumber, boolean inObjStm) throws IOException(Code)
Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing!
Parameters:
  object -
Parameters:
  refNumber -
Parameters:
  inObjStm - a PdfIndirectObject
throws:
  IOException -



addViewerPreference
public void addViewerPreference(PdfName key, PdfObject value)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfViewerPreferences.addViewerPreference(com.lowagie.text.pdf.PdfNamecom.lowagie.text.pdf.PdfObject)
See Also:   



breakTableIfDoesntFit
public boolean breakTableIfDoesntFit(PdfTable table) throws DocumentException(Code)
Row additions to the original Table used to build the PdfTable are processed and pre-rendered, and then the contents are deleted. If the pre-rendered table doesn't fit, then it is fully rendered and its data discarded. There shouldn't be any column change in the underlying Table object. (Contributed by dperezcar@fcc.es)
Parameters:
  table - The pre-rendered table obtained from PdfWriter.getPdfTable(Table) true if the table is rendered and emptied.
throws:
  DocumentException -
See Also:   PdfWriter.getPdfTable(Table)



clearTextWrap
public void clearTextWrap() throws DocumentException(Code)
Use this method to clear text wrapping around images (if applicable).
throws:
  DocumentException -



close
public void close()(Code)
Signals that the Document was closed and that no other Elements will be added.

The pages-tree is built and written to the outputstream. A Catalog is constructed, as well as an Info-object, the referencetable is composed and everything is written to the outputstream embedded in a Trailer.
See Also:   com.lowagie.text.DocWriter.close




createXmpMetadata
public void createXmpMetadata()(Code)
Use this method to creates XMP Metadata based on the metadata in the PdfDocument.



eliminateFontSubset
void eliminateFontSubset(PdfDictionary fonts)(Code)



fitsPage
public boolean fitsPage(Table table, float margin)(Code)
Checks if a Table fits the current page of the PdfDocument.
Parameters:
  table - the table that has to be checked
Parameters:
  margin - a certain margin true if the Table fits the page, false otherwise.



fitsPage
public boolean fitsPage(Table table)(Code)
Checks if a Table fits the current page of the PdfDocument.
Parameters:
  table - the table that has to be checked true if the Table fits the page, false otherwise.



fitsPage
public boolean fitsPage(PdfPTable table, float margin)(Code)
Checks if a PdfPTable fits the current page of the PdfDocument.
Parameters:
  table - the table that has to be checked
Parameters:
  margin - a certain margin true if the PdfPTable fits the page, false otherwise.



fitsPage
public boolean fitsPage(PdfPTable table)(Code)
Checks if a PdfPTable fits the current page of the PdfDocument.
Parameters:
  table - the table that has to be checked true if the PdfPTable fits the page, false otherwise.



freeReader
public void freeReader(PdfReader reader) throws IOException(Code)
Use this method to writes the reader to the document and free the memory used by it. The main use is when concatenating multiple documents to keep the memory usage restricted to the current appending document.
Parameters:
  reader - the PdfReader to free
throws:
  IOException - on error



getAcroForm
public PdfAcroForm getAcroForm()(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfAnnotations.getAcroForm
See Also:   



getBoxSize
public Rectangle getBoxSize(String boxName)(Code)
Use this method to get the size of a trim, art, crop or bleed box, or null if not defined.
Parameters:
  boxName - crop, trim, art or bleed



getCatalog
protected PdfDictionary getCatalog(PdfIndirectReference rootObj)(Code)



getColorspaceName
PdfName getColorspaceName()(Code)



getCurrentDocumentSize
public int getCurrentDocumentSize()(Code)
Use this method to gets the current document size. This size only includes the data already writen to the output stream, it does not include templates or fonts. It is usefull if used with freeReader() when concatenating many documents and an idea of the current size is needed. the approximate size without fonts or templates



getCurrentPage
PdfIndirectReference getCurrentPage()(Code)



getCurrentPageNumber
public int getCurrentPageNumber()(Code)



getDefaultColorspace
public PdfDictionary getDefaultColorspace()(Code)
Use this method to get the default colorspaces. the default colorspaces



getDirectContent
public PdfContentByte getDirectContent()(Code)
Use this method to get the direct content for this document. There is only one direct content, multiple calls to this method will allways retrieve the same object. the direct content



getDirectContentUnder
public PdfContentByte getDirectContentUnder()(Code)
Use this method to get the direct content under for this document. There is only one direct content, multiple calls to this method will allways retrieve the same object. the direct content



getEncryption
PdfEncryption getEncryption()(Code)



getExtraCatalog
public PdfDictionary getExtraCatalog()(Code)
Sets extra keys to the catalog. the catalog to change



getGroup
public PdfDictionary getGroup()(Code)
Use this method to get the group dictionary. Value of property group.



getImageReference
PdfIndirectReference getImageReference(PdfName name)(Code)
return the PdfIndirectReference to the image with a given name.
Parameters:
  name - the name of the image a PdfIndirectReference



getImportedPage
public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber)(Code)
Use this method to get a page from other PDF document. The page can be used as any other PdfTemplate. Note that calling this method more than once with the same parameters will retrieve the same object.
Parameters:
  reader - the PDF document where the page is
Parameters:
  pageNumber - the page number. The first page is 1 the template representing the imported page



getIndirectReferenceNumber
int getIndirectReferenceNumber()(Code)



getInfo
public PdfDictionary getInfo()(Code)
Use this method to get the info dictionary if you want to change it directly (add keys and values to the info dictionary). the info dictionary



getInstance
public static PdfWriter getInstance(Document document, OutputStream os) throws DocumentException(Code)
Use this method to get an instance of the PdfWriter.
Parameters:
  document - The Document that has to be written
Parameters:
  os - The OutputStream the writer has to write to. a new PdfWriter
throws:
  DocumentException - on error



getInstance
public static PdfWriter getInstance(Document document, OutputStream os, DocListener listener) throws DocumentException(Code)
Use this method to get an instance of the PdfWriter. a new PdfWriter
Parameters:
  document - The Document that has to be written
Parameters:
  os - The OutputStream the writer has to write to.
Parameters:
  listener - A DocListener to pass to the PdfDocument.
throws:
  DocumentException - on error



getNewObjectNumber
protected int getNewObjectNumber(PdfReader reader, int number, int generation)(Code)



getOCProperties
public PdfOCProperties getOCProperties()(Code)
Use this method to get the Optional Content Properties Dictionary. Each call fills the dictionary with the current layer state. It's advisable to only call this method right before close and do any modifications at that time. the Optional Content Properties Dictionary



getOs
OutputStreamCounter getOs()(Code)
Returns the outputStreamCounter. the outputStreamCounter



getPDFXConformance
public int getPDFXConformance()(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfXConformance.getPDFXConformance
See Also:   



getPageEvent
public PdfPageEvent getPageEvent()(Code)
Gets the PdfPageEvent for this document or null if none is set. the PdfPageEvent for this document or nullif none is set



getPageNumber
public int getPageNumber()(Code)
Gets the pagenumber of this document. This number can be different from the real pagenumber, if you have (re)set the page number previously. a page number



getPageReference
public PdfIndirectReference getPageReference(int page)(Code)
Use this method to get a reference to a page existing or not. If the page does not exist yet the reference will be created in advance. If on closing the document, a page number greater than the total number of pages was requested, an exception is thrown.
Parameters:
  page - the page number. The first page is 1 the reference to the page



getPageSize
public Rectangle getPageSize()(Code)
Use this method to get the size of the media box. a Rectangle



getPdfDocument
PdfDocument getPdfDocument()(Code)
Gets the PdfDocument associated with this writer. the PdfDocument



getPdfIndirectReference
public PdfIndirectReference getPdfIndirectReference()(Code)
Use this to get an PdfIndirectReference for an object that will be created in the future. Use this method only if you know what you're doing! the PdfIndirectReference



getPdfTable
public PdfTable getPdfTable(Table table)(Code)
Gets a pre-rendered table. (Contributed by dperezcar@fcc.es)
Parameters:
  table - Contains the table definition. Its contents are deleted, after being pre-rendered. a PdfTable



getPdfVersion
PdfVersionImp getPdfVersion()(Code)
Returns the version information.



getReaderFile
RandomAccessFileOrArray getReaderFile(PdfReader reader)(Code)



getRootOutline
public PdfOutline getRootOutline()(Code)
Use this method to get the root outline and construct bookmarks. the root outline



getRunDirection
public int getRunDirection()(Code)
Use this method to set the run direction. the run direction



getSpaceCharRatio
public float getSpaceCharRatio()(Code)
Use this method to gets the space/character extra spacing ratio for fully justified text. the space/character extra spacing ratio



getStructureTreeRoot
public PdfStructureTreeRoot getStructureTreeRoot()(Code)
Gets the structure tree root. If the document is not marked for tagging it will return null. the structure tree root



getTableBottom
public float getTableBottom(Table table)(Code)
Sometimes it is necessary to know where the just added Table ends. For instance to avoid to add another table in a page that is ending up, because the new table will be probably splitted just after the header (it is an unpleasant effect, isn't it?). Added on September 8th, 2001 by Francesco De Milato francesco.demilato@tiscalinet.it
Parameters:
  table - the Table the bottom height of the just added table



getUserunit
public float getUserunit()(Code)
Use this method to get the user unit. A user unit is a value that defines the default user space unit. The minimum UserUnit is 1 (1 unit = 1/72 inch). The maximum UserUnit is 75,000. Note that this userunit only works starting with PDF1.6! Returns the userunit.



getVerticalPosition
public float getVerticalPosition(boolean ensureNewLine)(Code)
Use this method to get the current vertical page position.
Parameters:
  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 getterminated. The current vertical page position.



isFullCompression
public boolean isFullCompression()(Code)
Use this method to find out if 1.5 compression is on. the 1.5 compression status



isPdfX
public boolean isPdfX()(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfXConformance.isPdfX
See Also:   



isStrictImageSequence
public boolean isStrictImageSequence()(Code)
Use this method to get the strictImageSequence status. value of property strictImageSequence



isTagged
public boolean isTagged()(Code)
Check if the document is marked for tagging. true if the document is marked for tagging



isUserProperties
public boolean isUserProperties()(Code)
Gets the flag indicating the presence of structure elements that contain user properties attributes. the user properties flag



open
public void open()(Code)
Signals that the Document has been opened and that Elements can be added.

When this method is called, the PDF-document header is written to the outputstream.
See Also:   com.lowagie.text.DocWriter.open




propertyExists
boolean propertyExists(Object prop)(Code)



registerLayer
void registerLayer(PdfOCG layer)(Code)



releaseTemplate
public void releaseTemplate(PdfTemplate tp) throws IOException(Code)
Use this method to releases the memory used by a template. This method writes the template to the output. The template can still be added to any content but changes to the template itself won't have any effect.
Parameters:
  tp - the template to release
throws:
  IOException - on error



reorderPages
public int reorderPages(int order) throws DocumentException(Code)
Use this method to reorder the pages in the document. A null argument value only returns the number of pages to process. It is advisable to issue a Document.newPage() before using this method. the total number of pages
Parameters:
  order - an array with the new page sequence. It must have thesame size as the number of pages.
throws:
  DocumentException - if all the pages are not present in the array



resetContent
void resetContent()(Code)
Resets all the direct contents to empty. This happens when a new page is started.



setAdditionalAction
public void setAdditionalAction(PdfName actionType, PdfAction action) throws DocumentException(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfDocumentActions.setAdditionalAction(com.lowagie.text.pdf.PdfNamecom.lowagie.text.pdf.PdfAction)
See Also:   



setAtLeastPdfVersion
public void setAtLeastPdfVersion(char version)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfVersion.setAtLeastPdfVersion(char)
See Also:   



setBoxSize
public void setBoxSize(String boxName, Rectangle size)(Code)
Use this method to set the page box sizes. Allowed names are: "crop", "trim", "art" and "bleed".
Parameters:
  boxName - the box size
Parameters:
  size - the size



setCollection
public void setCollection(PdfCollection collection)(Code)
Use this method to add the Collection dictionary.
Parameters:
  collection - a dictionary of type PdfCollection



setCropBoxSize
public void setCropBoxSize(Rectangle crop)(Code)
Use this method to set the crop box. The crop box should not be rotated even if the page is rotated. This change only takes effect in the next page.
Parameters:
  crop - the crop box



setDefaultColorspace
public void setDefaultColorspace(PdfName key, PdfObject cs)(Code)
Use this method to sets the default colorspace that will be applied to all the document. The colorspace is only applied if another colorspace with the same name is not present in the content.

The colorspace is applied immediately when creating templates and at the page end for the main document content.
Parameters:
  key - the name of the colorspace. It can be PdfName.DEFAULTGRAY, PdfName.DEFAULTRGBor PdfName.DEFAULTCMYK
Parameters:
  cs - the colorspace. A null or PdfNull removes any colorspace with the same name




setDuration
public void setDuration(int seconds)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfPageActions.setDuration(int)
See Also:   



setEncryption
public void setEncryption(byte userPassword, byte ownerPassword, int permissions, int encryptionType) throws DocumentException(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfEncryptionSettings.setEncryption(byte[]byte[]intint)
See Also:   



setEncryption
public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfEncryptionSettings.setEncryption(java.security.cert.Certificate[]int[]int)
See Also:   



setEncryption
public void setEncryption(byte userPassword, byte ownerPassword, int permissions, boolean strength128Bits) throws DocumentException(Code)
Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
Parameters:
  userPassword - the user password. Can be null or empty
Parameters:
  ownerPassword - the owner password. Can be null or empty
Parameters:
  permissions - the user permissions
Parameters:
  strength128Bits - true for 128 bit key length, false for 40 bit key length
throws:
  DocumentException - if the document is already open



setEncryption
public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException(Code)
Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
Parameters:
  strength - true for 128 bit key length, false for 40 bit key length
Parameters:
  userPassword - the user password. Can be null or empty
Parameters:
  ownerPassword - the owner password. Can be null or empty
Parameters:
  permissions - the user permissions
throws:
  DocumentException - if the document is already open



setEncryption
public void setEncryption(int encryptionType, String userPassword, String ownerPassword, int permissions) throws DocumentException(Code)
Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
Parameters:
  encryptionType - the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
Parameters:
  userPassword - the user password. Can be null or empty
Parameters:
  ownerPassword - the owner password. Can be null or empty
Parameters:
  permissions - the user permissions
throws:
  DocumentException - if the document is already open



setFullCompression
public void setFullCompression()(Code)
Use this method to set the document's compression to the PDF 1.5 mode with object streams and xref streams. It can be set at any time but once set it can't be unset.

If set before opening the document it will also set the pdf version to 1.5.




setGroup
public void setGroup(PdfDictionary group)(Code)
Use this method to set the group dictionary.
Parameters:
  group - New value of property group.



setLinearPageMode
public void setLinearPageMode()(Code)
Use this method to make sure the page tree has a lineair structure (every leave is attached directly to the root). Use this method to allow page reordering with method reorderPages.



setOpenAction
public void setOpenAction(String name)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfDocumentActions.setOpenAction(java.lang.String)
See Also:   



setOpenAction
public void setOpenAction(PdfAction action)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfDocumentActions.setOpenAction(com.lowagie.text.pdf.PdfAction)
See Also:   



setOutlines
public void setOutlines(java.util.List outlines)(Code)
Sets the bookmarks. The list structure is defined in SimpleBookmark .
Parameters:
  outlines - the bookmarks or null to remove any



setOutputIntents
public void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, byte destOutputProfile) throws IOException(Code)
Use this method to set the values of the output intent dictionary. Null values are allowed to suppress any key.
Parameters:
  outputConditionIdentifier - a value
Parameters:
  outputCondition - a value
Parameters:
  registryName - a value
Parameters:
  info - a value
Parameters:
  destOutputProfile - a value
throws:
  IOException - on error



setOutputIntents
public boolean setOutputIntents(PdfReader reader, boolean checkExistence) throws IOException(Code)
Use this method to copy the output intent dictionary from another document to this one.
Parameters:
  reader - the other document
Parameters:
  checkExistence - true to just check for the existence of a valid output intentdictionary, false to insert the dictionary if it exists
throws:
  IOException - on error true if the output intent dictionary exists, falseotherwise



setPDFXConformance
public void setPDFXConformance(int pdfx)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfXConformance.setPDFXConformance(int)
See Also:   



setPageAction
public void setPageAction(PdfName actionType, PdfAction action) throws DocumentException(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfPageActions.setPageAction(com.lowagie.text.pdf.PdfNamecom.lowagie.text.pdf.PdfAction)
See Also:   



setPageEmpty
public void setPageEmpty(boolean pageEmpty)(Code)
Use this method to make sure a page is added, even if it's empty. If you use setPageEmpty(false), invoking newPage() after a blank page will add a newPage.
Parameters:
  pageEmpty - the state



setPageEvent
public void setPageEvent(PdfPageEvent event)(Code)
Sets the PdfPageEvent for this document.
Parameters:
  event - the PdfPageEvent for this document



setPageLabels
public void setPageLabels(PdfPageLabels pageLabels)(Code)
Use this method to add page labels
Parameters:
  pageLabels - the page labels



setPageXmpMetadata
public void setPageXmpMetadata(byte[] xmpMetadata)(Code)
Use this method to set the XMP Metadata for each page.
Parameters:
  xmpMetadata - The xmpMetadata to set.



setPdfVersion
public void setPdfVersion(char version)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfVersion.setPdfVersion(char)
See Also:   



setPdfVersion
public void setPdfVersion(PdfName version)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfVersion.setPdfVersion(com.lowagie.text.pdf.PdfName)
See Also:   



setRunDirection
public void setRunDirection(int runDirection)(Code)
Use this method to set the run direction. This is only used as a placeholder as it does not affect anything.
Parameters:
  runDirection - the run direction



setSigFlags
public void setSigFlags(int f)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfAnnotations.setSigFlags(int)
See Also:   



setSpaceCharRatio
public void setSpaceCharRatio(float spaceCharRatio)(Code)
Use this method to set the ratio between the extra word spacing and the extra character spacing when the text is fully justified. Extra word spacing will grow spaceCharRatio times more than extra character spacing. If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO then the extra character spacing will be zero.
Parameters:
  spaceCharRatio - the ratio between the extra word spacing and the extra character spacing



setStrictImageSequence
public void setStrictImageSequence(boolean strictImageSequence)(Code)
Use this method to set the image sequence, so that it follows the text in strict order (or not).
Parameters:
  strictImageSequence - new value of property strictImageSequence



setTagged
public void setTagged()(Code)
Mark this document for tagging. It must be called before open.



setThumbnail
public void setThumbnail(Image image) throws PdfException, DocumentException(Code)
Use this method to set the thumbnail image for the current page.
Parameters:
  image - the image
throws:
  PdfException - on error
throws:
  DocumentException - or error



setTransition
public void setTransition(PdfTransition transition)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfPageActions.setTransition(com.lowagie.text.pdf.PdfTransition)
See Also:   



setUserProperties
public void setUserProperties(boolean userProperties)(Code)
Sets the flag indicating the presence of structure elements that contain user properties attributes.
Parameters:
  userProperties - the user properties flag



setUserunit
public void setUserunit(float userunit) throws DocumentException(Code)
Use this method to set the user unit. A UserUnit is a value that defines the default user space unit. The minimum UserUnit is 1 (1 unit = 1/72 inch). The maximum UserUnit is 75,000. Note that this userunit only works starting with PDF1.6!
Parameters:
  userunit - The userunit to set.
throws:
  DocumentException - on error



setViewerPreferences
public void setViewerPreferences(int preferences)(Code)

See Also:   com.lowagie.text.pdf.interfaces.PdfViewerPreferences.setViewerPreferences(int)
See Also:   



setXmpMetadata
public void setXmpMetadata(byte[] xmpMetadata)(Code)
Use this method to set the XMP Metadata.
Parameters:
  xmpMetadata - The xmpMetadata to set.



writeOutlines
protected void writeOutlines(PdfDictionary catalog, boolean namedAsNames) throws IOException(Code)



Fields inherited from com.lowagie.text.DocWriter
final public static byte EQUALS(Code)(Java Doc)
final public static byte FORWARD(Code)(Java Doc)
final public static byte GT(Code)(Java Doc)
final public static byte LT(Code)(Java Doc)
final public static byte NEWLINE(Code)(Java Doc)
final public static byte QUOTE(Code)(Java Doc)
final public static byte SPACE(Code)(Java Doc)
final public static byte TAB(Code)(Java Doc)
protected boolean closeStream(Code)(Java Doc)
protected Document document(Code)(Java Doc)
protected boolean open(Code)(Java Doc)
protected OutputStreamCounter os(Code)(Java Doc)
protected Rectangle pageSize(Code)(Java Doc)
protected boolean pause(Code)(Java Doc)

Methods inherited from com.lowagie.text.DocWriter
public boolean add(Element element) throws DocumentException(Code)(Java Doc)
protected void addTabs(int indent) throws IOException(Code)(Java Doc)
public void close()(Code)(Java Doc)
public void flush()(Code)(Java Doc)
final public static byte[] getISOBytes(String text)(Code)(Java Doc)
public boolean isCloseStream()(Code)(Java Doc)
public boolean isPaused()(Code)(Java Doc)
public boolean newPage()(Code)(Java Doc)
public void open()(Code)(Java Doc)
public void pause()(Code)(Java Doc)
public void resetFooter()(Code)(Java Doc)
public void resetHeader()(Code)(Java Doc)
public void resetPageCount()(Code)(Java Doc)
public void resume()(Code)(Java Doc)
public void setCloseStream(boolean closeStream)(Code)(Java Doc)
public void setFooter(HeaderFooter footer)(Code)(Java Doc)
public void setHeader(HeaderFooter header)(Code)(Java Doc)
public boolean setMarginMirroring(boolean MarginMirroring)(Code)(Java Doc)
public boolean setMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)(Code)(Java Doc)
public void setPageCount(int pageN)(Code)(Java Doc)
public boolean setPageSize(Rectangle pageSize)(Code)(Java Doc)
protected void write(String string) throws IOException(Code)(Java Doc)
protected void write(String key, String value) throws IOException(Code)(Java Doc)
protected void writeEnd(String tag) throws IOException(Code)(Java Doc)
protected void writeEnd() throws IOException(Code)(Java Doc)
protected boolean writeMarkupAttributes(Properties markup) throws IOException(Code)(Java Doc)
protected void writeStart(String tag) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.