Java Doc for PdfStamper.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.pdf.PdfStamper

PdfStamper
public class PdfStamper implements PdfViewerPreferences,PdfEncryptionSettings(Code)
Applies extra content to the pages of a PDF document. This extra content can be all the objects allowed in PdfContentByte including pages from other Pdfs. The original PDF will keep all the interactive elements including bookmarks, links and form fields.

It is also possible to change the field values and to flatten them. New fields can be added but not flattened.
author:
   Paulo Soares (psoares@consiste.pt)



Field Summary
protected  PdfStamperImpstamper
    

Constructor Summary
public  PdfStamper(PdfReader reader, OutputStream os)
     Starts the process of adding extra content to an existing PDF document.
Parameters:
  reader - the original document.
public  PdfStamper(PdfReader reader, OutputStream os, char pdfVersion)
     Starts the process of adding extra content to an existing PDF document.
Parameters:
  reader - the original document.
public  PdfStamper(PdfReader reader, OutputStream os, char pdfVersion, boolean append)
     Starts the process of adding extra content to an existing PDF document, possibly as a new revision.
Parameters:
  reader - the original document.

Method Summary
public  voidaddAnnotation(PdfAnnotation annot, int page)
     Adds an annotation of form field in a specific page.
public  voidaddComments(FdfReader fdf)
     Adds the comments present in an FDF file.
public  voidaddFileAttachment(String description, byte fileStore, String file, String fileDisplay)
     Adds a file attachment at the document level.
public  voidaddFileAttachment(String description, PdfFileSpecification fs)
     Adds a file attachment at the document level.
public  voidaddJavaScript(String js)
     Adds a JavaScript action at the document level.
public  voidaddViewerPreference(PdfName key, PdfObject value)
    
public  voidclose()
     Closes the document.
public static  PdfStampercreateSignature(PdfReader reader, OutputStream os, char pdfVersion, File tempFile, boolean append)
     Applies a digital signature to a document, possibly as a new revision, making possible multiple signatures.
public static  PdfStampercreateSignature(PdfReader reader, OutputStream os, char pdfVersion)
     Applies a digital signature to a document.
public static  PdfStampercreateSignature(PdfReader reader, OutputStream os, char pdfVersion, File tempFile)
     Applies a digital signature to a document.
public  AcroFieldsgetAcroFields()
     Gets the AcroFields object that allows to get and set field values and to merge FDF forms.
public  PdfImportedPagegetImportedPage(PdfReader reader, int pageNumber)
     Gets a page from other PDF document.
public  HashMapgetMoreInfo()
     Gets the optional String map to add or change values in the info dictionary.
public  PdfContentBytegetOverContent(int pageNum)
     Gets a PdfContentByte to write over the page of the original document.
public  PdfReadergetReader()
     Gets the underlying PdfReader.
public  PdfSignatureAppearancegetSignatureAppearance()
     Gets the signing instance.
public  PdfContentBytegetUnderContent(int pageNum)
     Gets a PdfContentByte to write under the page of the original document.
public  PdfWritergetWriter()
     Gets the underlying PdfWriter.
public  voidinsertPage(int pageNumber, Rectangle mediabox)
     Inserts a blank page.
public  booleanisFullCompression()
     Gets the 1.5 compression status.
public  booleanisRotateContents()
     Checks if the content is automatically adjusted to compensate the original page rotation.
public  voidmakePackage(PdfName initialView)
     This is the most simple way to change a PDF into a portable collection.
public  voidmakePackage(PdfCollection collection)
     Adds or replaces the Collection Dictionary in the Catalog.
public  booleanpartialFormFlattening(String name)
     Adds name to the list of fields that will be flattened on close, all the other fields will remain.
public  voidsetDuration(int seconds, int page)
     Sets the display duration for the page (for presentations)
Parameters:
  seconds - the number of seconds to display the page.
public  voidsetEncryption(byte userPassword, byte ownerPassword, int permissions, boolean strength128Bits)
     Sets the encryption options for this document.
public  voidsetEncryption(byte userPassword, byte ownerPassword, int permissions, int encryptionType)
     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  voidsetEncryption(Certificate[] certs, int[] permissions, int encryptionType)
     Sets the certificate encryption options for this document.
public  voidsetFormFlattening(boolean flat)
     Determines if the fields are flattened on close.
public  voidsetFreeTextFlattening(boolean flat)
     Determines if the FreeText annotations are flattened on close.
public  voidsetFullCompression()
     Sets the document's compression to the new 1.5 mode with object streams and xref streams.
public  voidsetMoreInfo(HashMap moreInfo)
     An optional String map to add or change values in the info dictionary.
public  voidsetOutlines(List outlines)
     Sets the bookmarks.
public  voidsetPageAction(PdfName actionType, PdfAction action, int page)
     Sets the open and close page additional action.
Parameters:
  actionType - the action type.
public  voidsetRotateContents(boolean rotateContents)
     Flags the content to be automatically adjusted to compensate the original page rotation.
public  voidsetThumbnail(Image image, int page)
     Sets the thumbnail image for a page.
public  voidsetTransition(PdfTransition transition, int page)
     Sets the transition for the page
Parameters:
  transition - the transition object.
public  voidsetViewerPreferences(int preferences)
     Sets the viewer preferences.
public  voidsetXmpMetadata(byte[] xmp)
     Sets the XMP metadata.

Field Detail
stamper
protected PdfStamperImp stamper(Code)
The writer




Constructor Detail
PdfStamper
public PdfStamper(PdfReader reader, OutputStream os) throws DocumentException, IOException(Code)
Starts the process of adding extra content to an existing PDF document.
Parameters:
  reader - the original document. It cannot be reused
Parameters:
  os - the output stream
throws:
  DocumentException - on error
throws:
  IOException - on error



PdfStamper
public PdfStamper(PdfReader reader, OutputStream os, char pdfVersion) throws DocumentException, IOException(Code)
Starts the process of adding extra content to an existing PDF document.
Parameters:
  reader - the original document. It cannot be reused
Parameters:
  os - the output stream
Parameters:
  pdfVersion - the new pdf version or '\0' to keep the same version as the originaldocument
throws:
  DocumentException - on error
throws:
  IOException - on error



PdfStamper
public PdfStamper(PdfReader reader, OutputStream os, char pdfVersion, boolean append) throws DocumentException, IOException(Code)
Starts the process of adding extra content to an existing PDF document, possibly as a new revision.
Parameters:
  reader - the original document. It cannot be reused
Parameters:
  os - the output stream
Parameters:
  pdfVersion - the new pdf version or '\0' to keep the same version as the originaldocument
Parameters:
  append - if true appends the document changes as a new revision. This isonly useful for multiple signatures as nothing is gained in speed or memory
throws:
  DocumentException - on error
throws:
  IOException - on error




Method Detail
addAnnotation
public void addAnnotation(PdfAnnotation annot, int page)(Code)
Adds an annotation of form field in a specific page. This page number can be overridden with PdfAnnotation.setPlaceInPage(int) .
Parameters:
  annot - the annotation
Parameters:
  page - the page



addComments
public void addComments(FdfReader fdf) throws IOException(Code)
Adds the comments present in an FDF file.
Parameters:
  fdf - the FDF file
throws:
  IOException - on error



addFileAttachment
public void addFileAttachment(String description, byte fileStore, String file, String fileDisplay) throws IOException(Code)
Adds a file attachment at the document level. Existing attachments will be kept.
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)
Adds a file attachment at the document level. Existing attachments will be kept.
Parameters:
  description - the file description
Parameters:
  fs - the file specification



addJavaScript
public void addJavaScript(String js)(Code)
Adds a JavaScript action at the document level. When the document opens all this JavaScript runs. The existing JavaScript will be replaced.
Parameters:
  js - the JavaScript code



addViewerPreference
public void addViewerPreference(PdfName key, PdfObject value)(Code)
Adds a viewer preference
Parameters:
  key - a key for a viewer preference
Parameters:
  value - the value for the viewer preference
See Also:   PdfViewerPreferences.addViewerPreference



close
public void close() throws DocumentException, IOException(Code)
Closes the document. No more content can be written after the document is closed.

If closing a signed document with an external signature the closing must be done in the PdfSignatureAppearance instance.
throws:
  DocumentException - on error
throws:
  IOException - on error




createSignature
public static PdfStamper createSignature(PdfReader reader, OutputStream os, char pdfVersion, File tempFile, boolean append) throws DocumentException, IOException(Code)
Applies a digital signature to a document, possibly as a new revision, making possible multiple signatures. The returned PdfStamper can be used normally as the signature is only applied when closing.

A possible use for adding a signature without invalidating an existing one is:

 KeyStore ks = KeyStore.getInstance("pkcs12");
 ks.load(new FileInputStream("my_private_key.pfx"), "my_password".toCharArray());
 String alias = (String)ks.aliases().nextElement();
 PrivateKey key = (PrivateKey)ks.getKey(alias, "my_password".toCharArray());
 Certificate[] chain = ks.getCertificateChain(alias);
 PdfReader reader = new PdfReader("original.pdf");
 FileOutputStream fout = new FileOutputStream("signed.pdf");
 PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0', new
 File("/temp"), true);
 PdfSignatureAppearance sap = stp.getSignatureAppearance();
 sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
 sap.setReason("I'm the author");
 sap.setLocation("Lisbon");
 // comment next line to have an invisible signature
 sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null);
 stp.close();
 

Parameters:
  reader - the original document
Parameters:
  os - the output stream or null to keep the document in the temporary file
Parameters:
  pdfVersion - the new pdf version or '\0' to keep the same version as the originaldocument
Parameters:
  tempFile - location of the temporary file. If it's a directory a temporary file will be created there.If it's a file it will be used directly. The file will be deleted on exit unless os is null.In that case the document can be retrieved directly from the temporary file. If it's nullno temporary file will be created and memory will be used
Parameters:
  append - if true the signature and all the other content will be added as anew revision thus not invalidating existing signatures a PdfStamper
throws:
  DocumentException - on error
throws:
  IOException - on error



createSignature
public static PdfStamper createSignature(PdfReader reader, OutputStream os, char pdfVersion) throws DocumentException, IOException(Code)
Applies a digital signature to a document. The returned PdfStamper can be used normally as the signature is only applied when closing.

Note that the pdf is created in memory.

A possible use is:

 KeyStore ks = KeyStore.getInstance("pkcs12");
 ks.load(new FileInputStream("my_private_key.pfx"), "my_password".toCharArray());
 String alias = (String)ks.aliases().nextElement();
 PrivateKey key = (PrivateKey)ks.getKey(alias, "my_password".toCharArray());
 Certificate[] chain = ks.getCertificateChain(alias);
 PdfReader reader = new PdfReader("original.pdf");
 FileOutputStream fout = new FileOutputStream("signed.pdf");
 PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0');
 PdfSignatureAppearance sap = stp.getSignatureAppearance();
 sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
 sap.setReason("I'm the author");
 sap.setLocation("Lisbon");
 // comment next line to have an invisible signature
 sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null);
 stp.close();
 

Parameters:
  reader - the original document
Parameters:
  os - the output stream
Parameters:
  pdfVersion - the new pdf version or '\0' to keep the same version as the originaldocument
throws:
  DocumentException - on error
throws:
  IOException - on error a PdfStamper



createSignature
public static PdfStamper createSignature(PdfReader reader, OutputStream os, char pdfVersion, File tempFile) throws DocumentException, IOException(Code)
Applies a digital signature to a document. The returned PdfStamper can be used normally as the signature is only applied when closing.

A possible use is:

 KeyStore ks = KeyStore.getInstance("pkcs12");
 ks.load(new FileInputStream("my_private_key.pfx"), "my_password".toCharArray());
 String alias = (String)ks.aliases().nextElement();
 PrivateKey key = (PrivateKey)ks.getKey(alias, "my_password".toCharArray());
 Certificate[] chain = ks.getCertificateChain(alias);
 PdfReader reader = new PdfReader("original.pdf");
 FileOutputStream fout = new FileOutputStream("signed.pdf");
 PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0', new File("/temp"));
 PdfSignatureAppearance sap = stp.getSignatureAppearance();
 sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
 sap.setReason("I'm the author");
 sap.setLocation("Lisbon");
 // comment next line to have an invisible signature
 sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null);
 stp.close();
 

Parameters:
  reader - the original document
Parameters:
  os - the output stream or null to keep the document in the temporary file
Parameters:
  pdfVersion - the new pdf version or '\0' to keep the same version as the originaldocument
Parameters:
  tempFile - location of the temporary file. If it's a directory a temporary file will be created there.If it's a file it will be used directly. The file will be deleted on exit unless os is null.In that case the document can be retrieved directly from the temporary file. If it's nullno temporary file will be created and memory will be used a PdfStamper
throws:
  DocumentException - on error
throws:
  IOException - on error



getAcroFields
public AcroFields getAcroFields()(Code)
Gets the AcroFields object that allows to get and set field values and to merge FDF forms. the AcroFields object



getImportedPage
public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber)(Code)
Gets a page from other PDF document. 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



getMoreInfo
public HashMap getMoreInfo()(Code)
Gets the optional String map to add or change values in the info dictionary. the map or null



getOverContent
public PdfContentByte getOverContent(int pageNum)(Code)
Gets a PdfContentByte to write over the page of the original document.
Parameters:
  pageNum - the page number where the extra content is written a PdfContentByte to write over the page ofthe original document



getReader
public PdfReader getReader()(Code)
Gets the underlying PdfReader. the underlying PdfReader



getSignatureAppearance
public PdfSignatureAppearance getSignatureAppearance()(Code)
Gets the signing instance. The appearances and other parameters can the be set. the signing instance



getUnderContent
public PdfContentByte getUnderContent(int pageNum)(Code)
Gets a PdfContentByte to write under the page of the original document.
Parameters:
  pageNum - the page number where the extra content is written a PdfContentByte to write under the page ofthe original document



getWriter
public PdfWriter getWriter()(Code)
Gets the underlying PdfWriter. the underlying PdfWriter



insertPage
public void insertPage(int pageNumber, Rectangle mediabox)(Code)
Inserts a blank page. All the pages above and including pageNumber will be shifted up. If pageNumber is bigger than the total number of pages the new page will be the last one.
Parameters:
  pageNumber - the page number position where the new page will be inserted
Parameters:
  mediabox - the size of the new page



isFullCompression
public boolean isFullCompression()(Code)
Gets the 1.5 compression status. true if the 1.5 compression is on



isRotateContents
public boolean isRotateContents()(Code)
Checks if the content is automatically adjusted to compensate the original page rotation. the auto-rotation status



makePackage
public void makePackage(PdfName initialView)(Code)
This is the most simple way to change a PDF into a portable collection. Choose one of the following names:
  • PdfName.D (detailed view)
  • PdfName.T (tiled view)
  • PdfName.H (hidden)
Pass this name as a parameter and your PDF will be a portable collection with all the embedded and attached files as entries.
Parameters:
  initialView - can be PdfName.D, PdfName.T or PdfName.H



makePackage
public void makePackage(PdfCollection collection)(Code)
Adds or replaces the Collection Dictionary in the Catalog.
Parameters:
  collection - the new collection dictionary.



partialFormFlattening
public boolean partialFormFlattening(String name)(Code)
Adds name to the list of fields that will be flattened on close, all the other fields will remain. If this method is never called or is called with invalid field names, all the fields will be flattened.

Calling setFormFlattening(true) is needed to have any kind of flattening.
Parameters:
  name - the field name true if the field exists, false otherwise




setDuration
public void setDuration(int seconds, int page)(Code)
Sets the display duration for the page (for presentations)
Parameters:
  seconds - the number of seconds to display the page. A negative value removes the entry
Parameters:
  page - the page where the duration will be applied. The first page is 1



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 anything was already written to the output



setEncryption
public void setEncryption(byte userPassword, byte ownerPassword, int permissions, int encryptionType) 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:
  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
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 anything was already written to the output



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 anything was already written to the output



setEncryption
public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException(Code)
Sets the certificate encryption options for this document. An array of one or more public certificates must be provided together with an array of the same size for the permissions for each certificate. 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. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
Parameters:
  certs - the public certificates to be used for the encryption
Parameters:
  permissions - the user permissions for each of the certicates
Parameters:
  encryptionType - the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
throws:
  DocumentException - if the encryption was set too late



setFormFlattening
public void setFormFlattening(boolean flat)(Code)
Determines if the fields are flattened on close. The fields added with PdfStamper.addAnnotation(PdfAnnotation,int) will never be flattened.
Parameters:
  flat - true to flatten the fields, falseto keep the fields



setFreeTextFlattening
public void setFreeTextFlattening(boolean flat)(Code)
Determines if the FreeText annotations are flattened on close.
Parameters:
  flat - true to flatten the FreeText annotations, false(the default) to keep the FreeText annotations as active content.



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



setMoreInfo
public void setMoreInfo(HashMap moreInfo)(Code)
An optional String map to add or change values in the info dictionary. Entries with null values delete the key in the original info dictionary
Parameters:
  moreInfo - additional entries to the info dictionary



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



setPageAction
public void setPageAction(PdfName actionType, PdfAction action, int page) throws PdfException(Code)
Sets the open and close page additional action.
Parameters:
  actionType - the action type. It can be PdfWriter.PAGE_OPENor PdfWriter.PAGE_CLOSE
Parameters:
  action - the action to perform
Parameters:
  page - the page where the action will be applied. The first page is 1
throws:
  PdfException - if the action type is invalid



setRotateContents
public void setRotateContents(boolean rotateContents)(Code)
Flags the content to be automatically adjusted to compensate the original page rotation. The default is true.
Parameters:
  rotateContents - true to set auto-rotation, falseotherwise



setThumbnail
public void setThumbnail(Image image, int page) throws PdfException, DocumentException(Code)
Sets the thumbnail image for a page.
Parameters:
  image - the image
Parameters:
  page - the page
throws:
  PdfException - on error
throws:
  DocumentException - on error



setTransition
public void setTransition(PdfTransition transition, int page)(Code)
Sets the transition for the page
Parameters:
  transition - the transition object. A null removes the transition
Parameters:
  page - the page where the transition will be applied. The first page is 1



setViewerPreferences
public void setViewerPreferences(int preferences)(Code)
Sets the viewer preferences.
Parameters:
  preferences - the viewer preferences
See Also:   PdfViewerPreferences.setViewerPreferences(int)



setXmpMetadata
public void setXmpMetadata(byte[] xmp)(Code)
Sets the XMP metadata.
Parameters:
  xmp -
See Also:   PdfWriter.setXmpMetadata(byte[])



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.