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

All known Subclasses:   com.lowagie.text.pdf.FdfReader,
PdfReader
public class PdfReader implements PdfViewerPreferences(Code)
Reads a PDF document.
author:
   Paulo Soares (psoares@consiste.pt)
author:
   Kazuya Ujihara

Inner Class :static class PageRefs

Field Summary
protected  PRAcroFormacroForm
    
protected  booleanacroFormParsed
    
protected  PdfDictionarycatalog
    
protected  Certificatecertificate
    
protected  KeycertificateKey
    
protected  StringcertificateKeyProvider
    
protected  booleanconsolidateNamedDestinations
    
protected  PdfEncryptiondecrypt
    
protected  booleanencrypted
    
final static  byteendobj
    
final static  byteendstream
    
protected  inteofPos
    
protected  intfreeXref
    
protected  intlastXref
    
protected  booleannewXrefType
    
protected  HashMapobjStmMark
    
protected  IntHashtableobjStmToOffset
    
protected  intpValue
    
final static  PdfNamepageInhCandidates
    
protected  PageRefspageRefs
    
protected  bytepassword
    
protected  charpdfVersion
    
protected  intrValue
    
protected  booleanrebuilt
    
 PdfDictionaryrootPages
    
protected  booleansharedStreams
    
protected  ArrayListstrings
    
protected  booleantampered
    
protected  PRTokenisertokens
    
protected  PdfDictionarytrailer
    
protected  intxref
    

Constructor Summary
protected  PdfReader()
    
public  PdfReader(String filename)
     Reads and parses a PDF document.
public  PdfReader(String filename, byte ownerPassword)
     Reads and parses a PDF document.
public  PdfReader(byte pdfIn)
     Reads and parses a PDF document.
public  PdfReader(byte pdfIn, byte ownerPassword)
     Reads and parses a PDF document.
public  PdfReader(String filename, Certificate certificate, Key certificateKey, String certificateKeyProvider)
     Reads and parses a PDF document.
public  PdfReader(URL url)
     Reads and parses a PDF document.
public  PdfReader(URL url, byte ownerPassword)
     Reads and parses a PDF document.
public  PdfReader(InputStream is, byte ownerPassword)
     Reads and parses a PDF document.
Parameters:
  is - the InputStream containing the document.
public  PdfReader(InputStream is)
     Reads and parses a PDF document.
Parameters:
  is - the InputStream containing the document.
public  PdfReader(RandomAccessFileOrArray raf, byte ownerPassword)
     Reads and parses a pdf document.
public  PdfReader(PdfReader reader)
     Creates an independent duplicate.

Method Summary
public static  byte[]ASCII85Decode(byte in)
     Decodes a stream that has the ASCII85Decode filter.
public static  byte[]ASCIIHexDecode(byte in)
     Decodes a stream that has the ASCIIHexDecode filter.
public static  byte[]FlateDecode(byte in)
     Decodes a stream that has the FlateDecode filter.
public static  byte[]FlateDecode(byte in, boolean strict)
     A helper to FlateDecode.
Parameters:
  in - the input data
Parameters:
  strict - true to read a correct stream.
public static  byte[]LZWDecode(byte in)
     Decodes a stream that has the LZWDecode filter.
public  PRIndirectReferenceaddPdfObject(PdfObject obj)
    
public  voidaddViewerPreference(PdfName key, PdfObject value)
    
public  voidclose()
    
public  byte[]computeUserPassword()
    
public  voidconsolidateNamedDestinations()
     Replaces all the local named links with the actual destinations.
public  intcreateFakeFontSubsets()
     Finds all the fonts not subset but embedded and marks them as subset.
public static  byte[]decodePredictor(byte in, PdfObject dicPar)
    
public  doubledumpPerc()
    
protected static  PdfDictionaryduplicatePdfDictionary(PdfDictionary original, PdfDictionary copy, PdfReader newReader)
    
protected static  PdfObjectduplicatePdfObject(PdfObject original, PdfReader newReader)
    
public  voideliminateSharedStreams()
     Eliminates shared streams if they exist.
static  booleanequalsn(byte a1, byte a2)
    
static  booleanexistsName(PdfDictionary dic, PdfName key, PdfName value)
    
public  AcroFieldsgetAcroFields()
     Gets a read-only version of AcroFields.
public  PRAcroFormgetAcroForm()
     Returns the document's acroform, if it has one.
public  RectanglegetBoxSize(int index, String boxName)
     Gets the box size.
public  PdfDictionarygetCatalog()
     Returns the document's catalog.
public  intgetCertificationLevel()
     Gets the certification level for this document.
public  RectanglegetCropBox(int index)
     Gets the crop box without taking rotation into account.
public  intgetCryptoMode()
    
 PdfIndirectReferencegetCryptoRef()
    
 PdfEncryptiongetDecrypt()
    
public  intgetEofPos()
     Gets the byte address of the %%EOF marker.
public  intgetFileLength()
     Getter for property fileLength.
static  StringgetFontName(PdfDictionary dic)
    
public  HashMapgetInfo()
     Returns the content of the document information dictionary as a HashMap of String.
public  StringgetJavaScript(RandomAccessFileOrArray file)
     Gets the global document JavaScript.
public  StringgetJavaScript()
     Gets the global document JavaScript.
public  intgetLastXref()
     Gets the byte address of the last xref table.
public  ArrayListgetLinks(int page)
    
public  byte[]getMetadata()
     Gets the XML metadata.
public  HashMapgetNamedDestination()
     Gets all the named destinations as an HashMap.
public  HashMapgetNamedDestinationFromNames()
     Gets the named destinations from the /Dests key in the catalog as an HashMap.
public  HashMapgetNamedDestinationFromStrings()
     Gets the named destinations from the /Names key in the catalog as an HashMap.
public static  RectanglegetNormalizedRectangle(PdfArray box)
     Normalizes a Rectangle so that llx and lly are smaller than urx and ury.
public  intgetNumberOfPages()
     Gets the number of pages in the document.
public  byte[]getPageContent(int pageNum, RandomAccessFileOrArray file)
     Gets the contents of the page.
Parameters:
  pageNum - the page number.
public  byte[]getPageContent(int pageNum)
     Gets the contents of the page.
Parameters:
  pageNum - the page number.
public  PdfDictionarygetPageN(int pageNum)
     Gets the dictionary that represents a page.
Parameters:
  pageNum - the page number.
public  PdfDictionarygetPageNRelease(int pageNum)
    
public  PRIndirectReferencegetPageOrigRef(int pageNum)
     Gets the page reference to this page.
Parameters:
  pageNum - the page number.
public  intgetPageRotation(int index)
     Gets the page rotation.
 intgetPageRotation(PdfDictionary page)
    
public  RectanglegetPageSize(int index)
     Gets the page size without taking rotation into account.
public  RectanglegetPageSize(PdfDictionary page)
    
public  RectanglegetPageSizeWithRotation(int index)
     Gets the page size, taking rotation into account.
public  RectanglegetPageSizeWithRotation(PdfDictionary page)
     Gets the rotated page from a page dictionary.
public static  PdfObjectgetPdfObject(PdfObject obj)
     Reads a PdfObject resolving an indirect reference if needed.
public static  PdfObjectgetPdfObject(PdfObject obj, PdfObject parent)
    
public  PdfObjectgetPdfObject(int idx)
    
public static  PdfObjectgetPdfObjectRelease(PdfObject obj)
    
public static  PdfObjectgetPdfObjectRelease(PdfObject obj, PdfObject parent)
     Reads a PdfObject resolving an indirect reference if needed.
public  PdfObjectgetPdfObjectRelease(int idx)
    
protected  PdfReaderInstancegetPdfReaderInstance(PdfWriter writer)
    
public  chargetPdfVersion()
     Gets the PDF version.
public  intgetPermissions()
     Gets the encryption permissions.
public  RandomAccessFileOrArraygetSafeFile()
     Gets a new file instance of the original PDF document.
public  intgetSimpleViewerPreferences()
    
public static  byte[]getStreamBytes(PRStream stream, RandomAccessFileOrArray file)
     Get the content from a stream applying the required filters.
public static  byte[]getStreamBytes(PRStream stream)
     Get the content from a stream applying the required filters.
public static  byte[]getStreamBytesRaw(PRStream stream, RandomAccessFileOrArray file)
     Get the content from a stream as it is without applying any filter.
public static  byte[]getStreamBytesRaw(PRStream stream)
     Get the content from a stream as it is without applying any filter.
static  StringgetSubsetPrefix(PdfDictionary dic)
    
public  PdfDictionarygetTrailer()
    
public  intgetXrefSize()
     Gets the number of xref objects.
public  booleanis128Key()
     Returns true if the PDF has a 128 bit key encryption.
public  booleanisAppendable()
     Getter for property appendable.
public  booleanisEncrypted()
     Returns true if the PDF is encrypted.
public  booleanisHybridXref()
     Getter for property hybridXref.
public  booleanisMetadataEncrypted()
    
public  booleanisNewXrefType()
     Getter for property newXrefType.
final public  booleanisOpenedWithFullPermissions()
     Checks if the document was opened with the owner password so that the end application can decide what level of access restrictions to apply.
public  booleanisRebuilt()
     Checks if the document had errors and was rebuilt.
public  booleanisTampered()
     Checks if the document was changed.
public static  PdfObjectkillIndirect(PdfObject obj)
     Eliminates the reference to the object freeing the memory used by it and clearing the xref entry.
Parameters:
  obj - the object.
protected  voidkillXref(PdfObject obj)
    
protected  PdfArrayreadArray()
    
protected  PdfDictionaryreadDictionary()
    
protected  voidreadDocObj()
    
protected  voidreadDocObjPartial()
    
protected  voidreadObjStm(PRStream stream, IntHashtable map)
    
protected  PdfObjectreadOneObjStm(PRStream stream, int idx)
    
protected  PdfObjectreadPRObject()
    
protected  voidreadPages()
    
protected  voidreadPdf()
    
protected  voidreadPdfPartial()
    
protected  PdfObjectreadSingleObject(int k)
    
protected  booleanreadXRefStream(int ptr)
    
protected  voidreadXref()
    
protected  PdfDictionaryreadXrefSection()
    
protected  voidrebuildXref()
    
public  voidreleaseLastXrefPartial()
    
public static  voidreleaseLastXrefPartial(PdfObject obj)
    
public  voidreleasePage(int pageNum)
    
public  voidremoveAnnotations()
     Removes all the annotations and fields from the document.
public  voidremoveFields()
     Removes all the fields from the document.
protected  voidremoveUnusedNode(PdfObject obj, boolean hits)
    
public  intremoveUnusedObjects()
     Removes all the unreachable objects.
public  voidremoveUsageRights()
     Removes any usage rights that this PDF may have.
public  voidresetLastXrefPartial()
    
public  voidresetReleasePage()
    
public  voidselectPages(String ranges)
     Selects the pages to keep in the document.
public  voidselectPages(List pagesToKeep)
     Selects the pages to keep in the document.
public  voidsetAppendable(boolean appendable)
     Setter for property appendable.
public  voidsetPageContent(int pageNum, byte content)
     Sets the contents of the page.
Parameters:
  content - the new page content
Parameters:
  pageNum - the page number.
public  voidsetTampered(boolean tampered)
     Sets the tampered state.
public  voidsetViewerPreferences(int preferences)
     Sets the viewer preferences as the sum of several constants.
 voidsetViewerPreferences(PdfViewerPreferencesImp vp)
    
public  intshuffleSubsetNames()
     Finds all the font subsets and changes the prefixes to some random values.

Field Detail
acroForm
protected PRAcroForm acroForm(Code)



acroFormParsed
protected boolean acroFormParsed(Code)



catalog
protected PdfDictionary catalog(Code)



certificate
protected Certificate certificate(Code)



certificateKey
protected Key certificateKey(Code)



certificateKeyProvider
protected String certificateKeyProvider(Code)



consolidateNamedDestinations
protected boolean consolidateNamedDestinations(Code)



decrypt
protected PdfEncryption decrypt(Code)



encrypted
protected boolean encrypted(Code)



endobj
final static byte endobj(Code)



endstream
final static byte endstream(Code)



eofPos
protected int eofPos(Code)



freeXref
protected int freeXref(Code)



lastXref
protected int lastXref(Code)



newXrefType
protected boolean newXrefType(Code)



objStmMark
protected HashMap objStmMark(Code)



objStmToOffset
protected IntHashtable objStmToOffset(Code)



pValue
protected int pValue(Code)



pageInhCandidates
final static PdfName pageInhCandidates(Code)



pageRefs
protected PageRefs pageRefs(Code)



password
protected byte password(Code)



pdfVersion
protected char pdfVersion(Code)



rValue
protected int rValue(Code)



rebuilt
protected boolean rebuilt(Code)



rootPages
PdfDictionary rootPages(Code)



sharedStreams
protected boolean sharedStreams(Code)



strings
protected ArrayList strings(Code)



tampered
protected boolean tampered(Code)



tokens
protected PRTokeniser tokens(Code)



trailer
protected PdfDictionary trailer(Code)



xref
protected int xref(Code)




Constructor Detail
PdfReader
protected PdfReader()(Code)



PdfReader
public PdfReader(String filename) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  filename - the file name of the document
throws:
  IOException - on error



PdfReader
public PdfReader(String filename, byte ownerPassword) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  filename - the file name of the document
Parameters:
  ownerPassword - the password to read the document
throws:
  IOException - on error



PdfReader
public PdfReader(byte pdfIn) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  pdfIn - the byte array with the document
throws:
  IOException - on error



PdfReader
public PdfReader(byte pdfIn, byte ownerPassword) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  pdfIn - the byte array with the document
Parameters:
  ownerPassword - the password to read the document
throws:
  IOException - on error



PdfReader
public PdfReader(String filename, Certificate certificate, Key certificateKey, String certificateKeyProvider) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  filename - the file name of the document
Parameters:
  certificate - the certificate to read the document
Parameters:
  certificateKey - the private key of the certificate
Parameters:
  certificateKeyProvider - the security provider for certificateKey
throws:
  IOException - on error



PdfReader
public PdfReader(URL url) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  url - the URL of the document
throws:
  IOException - on error



PdfReader
public PdfReader(URL url, byte ownerPassword) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  url - the URL of the document
Parameters:
  ownerPassword - the password to read the document
throws:
  IOException - on error



PdfReader
public PdfReader(InputStream is, byte ownerPassword) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  is - the InputStream containing the document. The stream is read to theend but is not closed
Parameters:
  ownerPassword - the password to read the document
throws:
  IOException - on error



PdfReader
public PdfReader(InputStream is) throws IOException(Code)
Reads and parses a PDF document.
Parameters:
  is - the InputStream containing the document. The stream is read to theend but is not closed
throws:
  IOException - on error



PdfReader
public PdfReader(RandomAccessFileOrArray raf, byte ownerPassword) throws IOException(Code)
Reads and parses a pdf document. Contrary to the other constructors only the xref is read into memory. The reader is said to be working in "partial" mode as only parts of the pdf are read as needed. The pdf is left open but may be closed at any time with PdfReader.close(), reopen is automatic.
Parameters:
  raf - the document location
Parameters:
  ownerPassword - the password or null for no password
throws:
  IOException - on error



PdfReader
public PdfReader(PdfReader reader)(Code)
Creates an independent duplicate.
Parameters:
  reader - the PdfReader to duplicate




Method Detail
ASCII85Decode
public static byte[] ASCII85Decode(byte in)(Code)
Decodes a stream that has the ASCII85Decode filter.
Parameters:
  in - the input data the decoded data



ASCIIHexDecode
public static byte[] ASCIIHexDecode(byte in)(Code)
Decodes a stream that has the ASCIIHexDecode filter.
Parameters:
  in - the input data the decoded data



FlateDecode
public static byte[] FlateDecode(byte in)(Code)
Decodes a stream that has the FlateDecode filter.
Parameters:
  in - the input data the decoded data



FlateDecode
public static byte[] FlateDecode(byte in, boolean strict)(Code)
A helper to FlateDecode.
Parameters:
  in - the input data
Parameters:
  strict - true to read a correct stream. falseto try to read a corrupted stream the decoded data



LZWDecode
public static byte[] LZWDecode(byte in)(Code)
Decodes a stream that has the LZWDecode filter.
Parameters:
  in - the input data the decoded data



addPdfObject
public PRIndirectReference addPdfObject(PdfObject obj)(Code)

Parameters:
  obj - an indirect reference



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



close
public void close()(Code)
Closes the reader



computeUserPassword
public byte[] computeUserPassword()(Code)



consolidateNamedDestinations
public void consolidateNamedDestinations()(Code)
Replaces all the local named links with the actual destinations.



createFakeFontSubsets
public int createFakeFontSubsets()(Code)
Finds all the fonts not subset but embedded and marks them as subset. the number of fonts altered



decodePredictor
public static byte[] decodePredictor(byte in, PdfObject dicPar)(Code)

Parameters:
  in -
Parameters:
  dicPar - a byte array



dumpPerc
public double dumpPerc()(Code)
the percentage of the cross reference table that has been read



duplicatePdfDictionary
protected static PdfDictionary duplicatePdfDictionary(PdfDictionary original, PdfDictionary copy, PdfReader newReader)(Code)



duplicatePdfObject
protected static PdfObject duplicatePdfObject(PdfObject original, PdfReader newReader)(Code)



eliminateSharedStreams
public void eliminateSharedStreams()(Code)
Eliminates shared streams if they exist.



equalsn
static boolean equalsn(byte a1, byte a2)(Code)



existsName
static boolean existsName(PdfDictionary dic, PdfName key, PdfName value)(Code)



getAcroFields
public AcroFields getAcroFields()(Code)
Gets a read-only version of AcroFields. a read-only version of AcroFields



getAcroForm
public PRAcroForm getAcroForm()(Code)
Returns the document's acroform, if it has one. the document's acroform



getBoxSize
public Rectangle getBoxSize(int index, String boxName)(Code)
Gets the box size. Allowed names are: "crop", "trim", "art", "bleed" and "media".
Parameters:
  index - the page number. The first page is 1
Parameters:
  boxName - the box name the box rectangle or null



getCatalog
public PdfDictionary getCatalog()(Code)
Returns the document's catalog. This dictionary is not a copy, any changes will be reflected in the catalog. the document's catalog



getCertificationLevel
public int getCertificationLevel()(Code)
Gets the certification level for this document. The return values can be PdfSignatureAppearance.NOT_CERTIFIED, PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED, PdfSignatureAppearance.CERTIFIED_FORM_FILLING and PdfSignatureAppearance.CERTIFIED_FORM_FILLING_AND_ANNOTATIONS.

No signature validation is made, use the methods availabe for that in AcroFields.

gets the certification level for this document



getCropBox
public Rectangle getCropBox(int index)(Code)
Gets the crop box without taking rotation into account. This is the value of the /CropBox key. The crop box is the part of the document to be displayed or printed. It usually is the same as the media box but may be smaller. If the page doesn't have a crop box the page size will be returned.
Parameters:
  index - the page number. The first page is 1 the crop box



getCryptoMode
public int getCryptoMode()(Code)



getCryptoRef
PdfIndirectReference getCryptoRef()(Code)



getDecrypt
PdfEncryption getDecrypt()(Code)



getEofPos
public int getEofPos()(Code)
Gets the byte address of the %%EOF marker. the byte address of the %%EOF marker



getFileLength
public int getFileLength()(Code)
Getter for property fileLength. Value of property fileLength.



getFontName
static String getFontName(PdfDictionary dic)(Code)



getInfo
public HashMap getInfo()(Code)
Returns the content of the document information dictionary as a HashMap of String. content of the document information dictionary



getJavaScript
public String getJavaScript(RandomAccessFileOrArray file) throws IOException(Code)
Gets the global document JavaScript.
Parameters:
  file - the document file
throws:
  IOException - on error the global document JavaScript



getJavaScript
public String getJavaScript() throws IOException(Code)
Gets the global document JavaScript.
throws:
  IOException - on error the global document JavaScript



getLastXref
public int getLastXref()(Code)
Gets the byte address of the last xref table. the byte address of the last xref table



getLinks
public ArrayList getLinks(int page)(Code)



getMetadata
public byte[] getMetadata() throws IOException(Code)
Gets the XML metadata.
throws:
  IOException - on error the XML metadata



getNamedDestination
public HashMap getNamedDestination()(Code)
Gets all the named destinations as an HashMap. The key is the name and the value is the destinations array. gets all the named destinations



getNamedDestinationFromNames
public HashMap getNamedDestinationFromNames()(Code)
Gets the named destinations from the /Dests key in the catalog as an HashMap. The key is the name and the value is the destinations array. gets the named destinations



getNamedDestinationFromStrings
public HashMap getNamedDestinationFromStrings()(Code)
Gets the named destinations from the /Names key in the catalog as an HashMap. The key is the name and the value is the destinations array. gets the named destinations



getNormalizedRectangle
public static Rectangle getNormalizedRectangle(PdfArray box)(Code)
Normalizes a Rectangle so that llx and lly are smaller than urx and ury.
Parameters:
  box - the original rectangle a normalized Rectangle



getNumberOfPages
public int getNumberOfPages()(Code)
Gets the number of pages in the document. the number of pages in the document



getPageContent
public byte[] getPageContent(int pageNum, RandomAccessFileOrArray file) throws IOException(Code)
Gets the contents of the page.
Parameters:
  pageNum - the page number. 1 is the first
Parameters:
  file - the location of the PDF document
throws:
  IOException - on error the content



getPageContent
public byte[] getPageContent(int pageNum) throws IOException(Code)
Gets the contents of the page.
Parameters:
  pageNum - the page number. 1 is the first
throws:
  IOException - on error the content



getPageN
public PdfDictionary getPageN(int pageNum)(Code)
Gets the dictionary that represents a page.
Parameters:
  pageNum - the page number. 1 is the first the page dictionary



getPageNRelease
public PdfDictionary getPageNRelease(int pageNum)(Code)

Parameters:
  pageNum - a Dictionary object



getPageOrigRef
public PRIndirectReference getPageOrigRef(int pageNum)(Code)
Gets the page reference to this page.
Parameters:
  pageNum - the page number. 1 is the first the page reference



getPageRotation
public int getPageRotation(int index)(Code)
Gets the page rotation. This value can be 0, 90, 180 or 270.
Parameters:
  index - the page number. The first page is 1 the page rotation



getPageRotation
int getPageRotation(PdfDictionary page)(Code)



getPageSize
public Rectangle getPageSize(int index)(Code)
Gets the page size without taking rotation into account. This is the value of the /MediaBox key.
Parameters:
  index - the page number. The first page is 1 the page size



getPageSize
public Rectangle getPageSize(PdfDictionary page)(Code)
Gets the page from a page dictionary
Parameters:
  page - the page dictionary the page



getPageSizeWithRotation
public Rectangle getPageSizeWithRotation(int index)(Code)
Gets the page size, taking rotation into account. This is a Rectangle with the value of the /MediaBox and the /Rotate key.
Parameters:
  index - the page number. The first page is 1 a Rectangle



getPageSizeWithRotation
public Rectangle getPageSizeWithRotation(PdfDictionary page)(Code)
Gets the rotated page from a page dictionary.
Parameters:
  page - the page dictionary the rotated page



getPdfObject
public static PdfObject getPdfObject(PdfObject obj)(Code)
Reads a PdfObject resolving an indirect reference if needed.
Parameters:
  obj - the PdfObject to read the resolved PdfObject



getPdfObject
public static PdfObject getPdfObject(PdfObject obj, PdfObject parent)(Code)

Parameters:
  obj -
Parameters:
  parent - a PdfObject



getPdfObject
public PdfObject getPdfObject(int idx)(Code)

Parameters:
  idx - aPdfObject



getPdfObjectRelease
public static PdfObject getPdfObjectRelease(PdfObject obj)(Code)

Parameters:
  obj - a PdfObject



getPdfObjectRelease
public static PdfObject getPdfObjectRelease(PdfObject obj, PdfObject parent)(Code)
Reads a PdfObject resolving an indirect reference if needed. If the reader was opened in partial mode the object will be released to save memory.
Parameters:
  obj - the PdfObject to read
Parameters:
  parent - a PdfObject



getPdfObjectRelease
public PdfObject getPdfObjectRelease(int idx)(Code)

Parameters:
  idx - a PdfObject



getPdfReaderInstance
protected PdfReaderInstance getPdfReaderInstance(PdfWriter writer)(Code)



getPdfVersion
public char getPdfVersion()(Code)
Gets the PDF version. Only the last version char is returned. For example version 1.4 is returned as '4'. the PDF version



getPermissions
public int getPermissions()(Code)
Gets the encryption permissions. It can be used directly in PdfWriter.setEncryption(). the encryption permissions



getSafeFile
public RandomAccessFileOrArray getSafeFile()(Code)
Gets a new file instance of the original PDF document. a new file instance of the original PDF document



getSimpleViewerPreferences
public int getSimpleViewerPreferences()(Code)
an int that contains the Viewer Preferences.



getStreamBytes
public static byte[] getStreamBytes(PRStream stream, RandomAccessFileOrArray file) throws IOException(Code)
Get the content from a stream applying the required filters.
Parameters:
  stream - the stream
Parameters:
  file - the location where the stream is
throws:
  IOException - on error the stream content



getStreamBytes
public static byte[] getStreamBytes(PRStream stream) throws IOException(Code)
Get the content from a stream applying the required filters.
Parameters:
  stream - the stream
throws:
  IOException - on error the stream content



getStreamBytesRaw
public static byte[] getStreamBytesRaw(PRStream stream, RandomAccessFileOrArray file) throws IOException(Code)
Get the content from a stream as it is without applying any filter.
Parameters:
  stream - the stream
Parameters:
  file - the location where the stream is
throws:
  IOException - on error the stream content



getStreamBytesRaw
public static byte[] getStreamBytesRaw(PRStream stream) throws IOException(Code)
Get the content from a stream as it is without applying any filter.
Parameters:
  stream - the stream
throws:
  IOException - on error the stream content



getSubsetPrefix
static String getSubsetPrefix(PdfDictionary dic)(Code)



getTrailer
public PdfDictionary getTrailer()(Code)
Gets the trailer dictionary the trailer dictionary



getXrefSize
public int getXrefSize()(Code)
Gets the number of xref objects. the number of xref objects



is128Key
public boolean is128Key()(Code)
Returns true if the PDF has a 128 bit key encryption. true if the PDF has a 128 bit key encryption



isAppendable
public boolean isAppendable()(Code)
Getter for property appendable. Value of property appendable.



isEncrypted
public boolean isEncrypted()(Code)
Returns true if the PDF is encrypted. true if the PDF is encrypted



isHybridXref
public boolean isHybridXref()(Code)
Getter for property hybridXref. Value of property hybridXref.



isMetadataEncrypted
public boolean isMetadataEncrypted()(Code)



isNewXrefType
public boolean isNewXrefType()(Code)
Getter for property newXrefType. Value of property newXrefType.



isOpenedWithFullPermissions
final public boolean isOpenedWithFullPermissions()(Code)
Checks if the document was opened with the owner password so that the end application can decide what level of access restrictions to apply. If the document is not encrypted it will return true. true if the document was opened with the owner password or if it's not encrypted,false if the document was opened with the user password



isRebuilt
public boolean isRebuilt()(Code)
Checks if the document had errors and was rebuilt. true if rebuilt.



isTampered
public boolean isTampered()(Code)
Checks if the document was changed. true if the document was changed,false otherwise



killIndirect
public static PdfObject killIndirect(PdfObject obj)(Code)
Eliminates the reference to the object freeing the memory used by it and clearing the xref entry.
Parameters:
  obj - the object. If it's an indirect reference it will be eliminated the object or the already erased dereferenced object



killXref
protected void killXref(PdfObject obj)(Code)



readArray
protected PdfArray readArray() throws IOException(Code)



readDictionary
protected PdfDictionary readDictionary() throws IOException(Code)



readDocObj
protected void readDocObj() throws IOException(Code)



readDocObjPartial
protected void readDocObjPartial() throws IOException(Code)



readObjStm
protected void readObjStm(PRStream stream, IntHashtable map) throws IOException(Code)



readOneObjStm
protected PdfObject readOneObjStm(PRStream stream, int idx) throws IOException(Code)



readPRObject
protected PdfObject readPRObject() throws IOException(Code)



readPages
protected void readPages() throws IOException(Code)



readPdf
protected void readPdf() throws IOException(Code)



readPdfPartial
protected void readPdfPartial() throws IOException(Code)



readSingleObject
protected PdfObject readSingleObject(int k) throws IOException(Code)



readXRefStream
protected boolean readXRefStream(int ptr) throws IOException(Code)



readXref
protected void readXref() throws IOException(Code)



readXrefSection
protected PdfDictionary readXrefSection() throws IOException(Code)



rebuildXref
protected void rebuildXref() throws IOException(Code)



releaseLastXrefPartial
public void releaseLastXrefPartial()(Code)



releaseLastXrefPartial
public static void releaseLastXrefPartial(PdfObject obj)(Code)

Parameters:
  obj -



releasePage
public void releasePage(int pageNum)(Code)

Parameters:
  pageNum -



removeAnnotations
public void removeAnnotations()(Code)
Removes all the annotations and fields from the document.



removeFields
public void removeFields()(Code)
Removes all the fields from the document.



removeUnusedNode
protected void removeUnusedNode(PdfObject obj, boolean hits)(Code)



removeUnusedObjects
public int removeUnusedObjects()(Code)
Removes all the unreachable objects. the number of indirect objects removed



removeUsageRights
public void removeUsageRights()(Code)
Removes any usage rights that this PDF may have. Only Adobe can grant usage rights and any PDF modification with iText will invalidate them. Invalidated usage rights may confuse Acrobat and it's advisabe to remove them altogether.



resetLastXrefPartial
public void resetLastXrefPartial()(Code)



resetReleasePage
public void resetReleasePage()(Code)



selectPages
public void selectPages(String ranges)(Code)
Selects the pages to keep in the document. The pages are described as ranges. The page ordering can be changed but no page repetitions are allowed. Note that it may be very slow in partial mode.
Parameters:
  ranges - the comma separated ranges as described in SequenceList



selectPages
public void selectPages(List pagesToKeep)(Code)
Selects the pages to keep in the document. The pages are described as a List of Integer. The page ordering can be changed but no page repetitions are allowed. Note that it may be very slow in partial mode.
Parameters:
  pagesToKeep - the pages to keep in the document



setAppendable
public void setAppendable(boolean appendable)(Code)
Setter for property appendable.
Parameters:
  appendable - New value of property appendable.



setPageContent
public void setPageContent(int pageNum, byte content)(Code)
Sets the contents of the page.
Parameters:
  content - the new page content
Parameters:
  pageNum - the page number. 1 is the first



setTampered
public void setTampered(boolean tampered)(Code)
Sets the tampered state. A tampered PdfReader cannot be reused in PdfStamper.
Parameters:
  tampered - the tampered state



setViewerPreferences
public void setViewerPreferences(int preferences)(Code)
Sets the viewer preferences as the sum of several constants.
Parameters:
  preferences - the viewer preferences
See Also:   PdfViewerPreferences.setViewerPreferences



setViewerPreferences
void setViewerPreferences(PdfViewerPreferencesImp vp)(Code)



shuffleSubsetNames
public int shuffleSubsetNames()(Code)
Finds all the font subsets and changes the prefixes to some random values. the number of font subsets altered



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.