java.lang.Object | ||
↳ | com.pdftron.sdf.Doc | |
↳ | com.pdftron.pdf.PDFDoc |
PDFDoc is a high-level class describing a single PDF (Portable Document Format) document. Most applications using PDFNet will use this class to open existing PDF documents, or to create new PDF documents from scratch.
The class offers a number of entry points into the document. For example:
The class also offers utility methods to slit and merge PDF pages, to create new pages, to flatten forms, to change security settings, etc.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | PDFDoc.ActionTriggerMode | ||||||||||
enum | PDFDoc.FlattenMode | ||||||||||
enum | PDFDoc.InsertBookmarkMode | ||||||||||
enum | PDFDoc.SignaturesVerificationStatus |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | e_action_trigger_doc_did_print |
This constant is deprecated.
use DOC_DID_PRINT instead.
|
|||||||||
int | e_action_trigger_doc_did_save |
This constant is deprecated.
use DOC_DID_SAVE instead.
|
|||||||||
int | e_action_trigger_doc_will_close |
This constant is deprecated.
use DOC_WILL_CLOSE instead.
|
|||||||||
int | e_action_trigger_doc_will_print | This constant is deprecated. use ActionTriggerMode#DOC_will_PRINT instead. | |||||||||
int | e_action_trigger_doc_will_save |
This constant is deprecated.
use DOC_WILL_SAVE instead.
|
|||||||||
int | e_annots_only | ||||||||||
int | e_both | ||||||||||
int | e_flatten_all |
This constant is deprecated.
use ALL instead.
|
|||||||||
int | e_flatten_annots_only |
This constant is deprecated.
use ANNOTS instead.
|
|||||||||
int | e_flatten_forms_only |
This constant is deprecated.
use FORMS instead.
|
|||||||||
int | e_flatten_link_only |
This constant is deprecated.
use LINK instead.
|
|||||||||
int | e_forms_only | ||||||||||
int | e_insert_bookmark |
This constant is deprecated.
use INSERT instead.
|
|||||||||
int | e_none |
This constant is deprecated.
use NONE instead.
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public Filter | mCustomFilter |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PDFDoc()
Default constructor.
| |||||||||||
PDFDoc(SDFDoc sdfdoc)
Create a PDF document from an existing SDF/Cos document.
| |||||||||||
PDFDoc(String filepath)
Open an existing PDF document.
| |||||||||||
PDFDoc(Filter stream)
Open an existing PDF document.
| |||||||||||
PDFDoc(byte[] buf)
Open a SDF/Cos document from a memory buffer.
| |||||||||||
PDFDoc(InputStream stream)
Open an existing PDF document from an InputStream.
| |||||||||||
PDFDoc(InputStream stream, int size)
Open an existing PDF document from an InputStream.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static PDFDoc | __Create(long impl) | ||||||||||
long | __GetHandle() | ||||||||||
void |
addFileAttachment(String file_key, FileSpec embedded_file)
Associates a file attachment with the document.
| ||||||||||
void |
addHighlights(String hilite)
AddHighlights is used to highlight text in a document using 'Adobe's
Highlight File Format' (Technical Note #5172 ).
| ||||||||||
void |
addRootBookmark(Bookmark root_bookmark)
Adds/links the specified Bookmark to the root level of document's outline
tree.
| ||||||||||
long |
addSignatureHandler(SignatureHandler signature_handler)
Adds a signature handler to the signature manager.
| ||||||||||
long |
addStdSignatureHandler(byte[] pkcs12_keybuffer, String pkcs12_keypass)
Adds a standard (built-in) signature handler to the signature manager.
| ||||||||||
long |
addStdSignatureHandler(String pkcs12_keyfile, String pkcs12_keypass)
Adds a standard (built-in) signature handler to the signature manager.
| ||||||||||
int |
appendTextDiff(PDFDoc doc1, PDFDoc doc2)
Imports two external PDFs and highlights the differences between them.
| ||||||||||
int |
appendTextDiff(PDFDoc doc1, PDFDoc doc2, TextDiffOptions options)
Imports two external PDFs and highlights the differences between them.
| ||||||||||
int |
appendTextDiff(Page page1, Page page2)
Imports two external pages and highlights the differences between them.
| ||||||||||
void |
appendVisualDiff(Page p1, Page p2, DiffOptions opts)
Generates a PDF diff of the given pages by overlaying and blending them on top of each other,
then appends that diff as a new page in this document.
| ||||||||||
void |
close()
Destructor.
| ||||||||||
DigitalSignatureField | createDigitalSignatureField() | ||||||||||
DigitalSignatureField |
createDigitalSignatureField(String in_sig_field_name)
Creates an unsigned digital signature form field inside the document.
| ||||||||||
Obj |
createIndirectArray()
Create the indirect array.
| ||||||||||
Obj |
createIndirectBool(boolean value)
Create the indirect boolean.
| ||||||||||
Obj |
createIndirectDict()
Create the indirect dictionary
| ||||||||||
Obj |
createIndirectName(String name)
Create SDF/Cos indirect name
Unlike direct objects, indirect objects can be referenced by more than
one object (i.e.
| ||||||||||
Obj |
createIndirectNull()
Create the indirect null.
| ||||||||||
Obj |
createIndirectNumber(double value)
Create the indirect number.
| ||||||||||
Obj |
createIndirectStream(FilterReader data)
Create the indirect stream.
| ||||||||||
Obj |
createIndirectStream(FilterReader data, Filter filter_chain)
Create the indirect stream.
| ||||||||||
Obj |
createIndirectStream(byte[] data)
Create the indirect stream.
| ||||||||||
Obj |
createIndirectStream(byte[] data, Filter filter_chain)
Create the indirect stream.
| ||||||||||
Obj |
createIndirectString(byte[] value)
Create the indirect string from buffer
| ||||||||||
Obj |
createIndirectString(String str)
Create the indirect string.
| ||||||||||
FDFDoc |
fdfExtract(int extractFlag)
Extract form data and/or annotations to FDF
| ||||||||||
FDFDoc |
fdfExtract(Annot[] annotations)
Extract annotations to FDF
| ||||||||||
FDFDoc |
fdfExtract(PageSet pageToExtract, int extractFlag)
Extract form data and/or annotations to FDF
| ||||||||||
FDFDoc |
fdfExtract()
Extract form data to FDF
| ||||||||||
FDFDoc |
fdfExtract(ArrayList<Annot> annot_list)
Extract annotations to FDF
| ||||||||||
FDFDoc |
fdfExtract(ArrayList<Annot> annot_added, ArrayList<Annot> annot_modified, ArrayList<Annot> annot_deleted)
Extract annotations to FDF
| ||||||||||
void |
fdfMerge(FDFDoc fdf_doc)
Import form data from FDF file to PDF interactive form.
| ||||||||||
void |
fdfUpdate(FDFDoc fdf_doc)
Replace existing form and annotation data with those imported from the FDF file.
| ||||||||||
Field |
fieldCreate(String field_name, int type, String field_value)
Create a new interactive form field
| ||||||||||
Field |
fieldCreate(String field_name, int type, String field_value, String def_field_value)
Create a new interactive form field
| ||||||||||
Field |
fieldCreate(String field_name, int type)
Create a new interactive form Field.
| ||||||||||
Field |
fieldCreate(String field_name, int type, Obj field_value)
Create a new interactive form field
| ||||||||||
Field |
fieldCreate(String field_name, int type, Obj field_value, Obj def_field_value)
Create a new interactive form field
| ||||||||||
void |
flattenAnnotations(boolean forms_only)
Flatten all annotations in the document.
| ||||||||||
void |
flattenAnnotations()
Flatten all annotations in the document.
| ||||||||||
void |
flattenAnnotationsAdvanced(long flags)
This method is deprecated.
use
flattenAnnotationsAdvanced(FlattenMode[]) instead.
Flatten annotations/forms/links in the document. | ||||||||||
void |
flattenAnnotationsAdvanced(FlattenMode[] flattenModes)
Flatten annotations/forms/links in the document.
| ||||||||||
void |
generateThumbnails(long size)
Generates thumbnail images for all the pages in this PDF document.
| ||||||||||
Obj |
getAcroForm()
Get the AcroForm Dictionary.
| ||||||||||
DigitalSignatureFieldIterator |
getDigitalSignatureFieldIterator()
Retrieves an iterator that iterates over digital signature fields.
| ||||||||||
DigitalSignatureField.DocumentPermissions |
getDigitalSignaturePermissions()
Retrieves the most restrictive document permissions locking level from
all of the signed digital signatures in the document.
| ||||||||||
PDFDocInfo |
getDocInfo()
Get the document infomation
| ||||||||||
long |
getDownloadedByteCount()
Returns the number of bytes that have been downloaded, when `hasDownloader()` is True.
| ||||||||||
Field |
getField(String field_name)
Get the specified field from field name
| ||||||||||
FieldIterator |
getFieldIterator(String field_name)
Get specified FieldIterator from field name
| ||||||||||
FieldIterator |
getFieldIterator()
An interactive form (sometimes referred to as an AcroForm) is a
collection of fields for gathering information interactively from the
user.
| ||||||||||
String |
getFileName()
Get the file name.
| ||||||||||
Bookmark |
getFirstBookmark()
Get the first bookmark.
| ||||||||||
Config |
getOCGConfig()
Get the optional group configuration
| ||||||||||
Obj |
getOCGs()
Get the optional content groups
| ||||||||||
Action |
getOpenAction()
Get the open action.
| ||||||||||
Page |
getPage(int page_number)
Get the page object from given page number
| ||||||||||
int |
getPageCount()
Get the page count.
| ||||||||||
PageIterator |
getPageIterator(int page_number)
Get the page iterator from given page number
| ||||||||||
PageIterator |
getPageIterator()
Get the page iterator.
| ||||||||||
PageLabel |
getPageLabel(int page_num)
Get the specified page label
| ||||||||||
Obj |
getPages()
Get the pages.
| ||||||||||
Obj |
getRoot()
Get the root of the document
| ||||||||||
SDFDoc |
getSDFDoc()
Get the underlying SDFDoc object.
| ||||||||||
SecurityHandler |
getSecurityHandler()
Get the security handler.
| ||||||||||
SignatureHandler |
getSignatureHandler(long signature_handler_id)
Gets the associated signature handler instance from the signature manager by looking it up with the handler name.
| ||||||||||
STree |
getStructTree()
Get the structure tree root
| ||||||||||
long |
getTotalRemoteByteCount()
Returns the document's total size in bytes, when `HasDownloader()` is True.
| ||||||||||
Obj |
getTrailer()
Get the document's trailer.
| ||||||||||
Obj |
getTriggerAction(PDFDoc.ActionTriggerMode triggerMode)
Get the Action associated with the selected PDFDoc Trigger event.
| ||||||||||
Obj |
getTriggerAction(int trigger)
This method is deprecated.
use
INCREMENTAL instead.
Get the Action associated with the selected PDFDoc Trigger event. | ||||||||||
UndoManager | getUndoManager() | ||||||||||
PDFDocViewPrefs |
getViewPrefs()
Get the view preferences
| ||||||||||
boolean |
hasChangesSinceSnapshot()
Call this function to determine whether the document has been modified
since the last Undo/Redo snapshot was taken
| ||||||||||
boolean |
hasDownloader()
Indicates whether this document was created via the `PDFViewCtrl` method `OpenURLAsync`.
| ||||||||||
boolean |
hasOC()
Checks for optional content
| ||||||||||
boolean |
hasRepairedXRef()
Checks whether or not the underlying file has an XRef table that had to be repaired
when the file was opened.
| ||||||||||
boolean |
hasSignatures()
Indicates whether this documents contains any digital signatures.
| ||||||||||
static int |
highlightTextDiff(PDFDoc doc1, PDFDoc doc2, TextDiffOptions options)
Highlights the differences between the external PDFs.
| ||||||||||
Page[] |
importPages(Page[] pages, boolean import_bookmarks)
Import given pages into current PDFDoc
| ||||||||||
Page[] |
importPages(Page[] pages)
The function imports a list of pages to this documents.
| ||||||||||
boolean |
initSecurityHandler(Object custom_data)
Initialize the security handler.
| ||||||||||
boolean |
initSecurityHandler()
Initializes document's SecurityHandler.
| ||||||||||
boolean |
initStdSecurityHandler(String password)
Initializes document's SecurityHandler using the supplied password.
| ||||||||||
boolean |
initStdSecurityHandler(byte[] passwordBuffer)
Initializes document's SecurityHandler using the supplied password.
| ||||||||||
void |
initializeJSContext()
Initializes the JS context.
| ||||||||||
void |
insertPages(int insertBeforeThisPage, PDFDoc sourceDoc, int startPage, int endPage, int insertFlag, ProgressMonitor monitor)
This method is deprecated.
use
insertPages(int, PDFDoc, int, int, InsertBookmarkMode, ProgressMonitor) instead.
Inserts a range of pages from specified PDFDoc | ||||||||||
void |
insertPages(int insertBeforeThisPage, PDFDoc sourceDoc, int startPage, int endPage, PDFDoc.InsertBookmarkMode insertBookmarkMode, ProgressMonitor monitor)
Inserts a range of pages from specified PDFDoc
| ||||||||||
void |
insertPages(int insertBeforeThisPage, PDFDoc sourceDoc, PageSet sourcePageSet, int insertFlag, ProgressMonitor monitor)
This method is deprecated.
use
insertPages(int, PDFDoc, PageSet, InsertBookmarkMode, ProgressMonitor) instead.
Inserts a range of pages from specified PDFDoc using PageSet | ||||||||||
void |
insertPages(int insertBeforeThisPage, PDFDoc sourceDoc, PageSet sourcePageSet, PDFDoc.InsertBookmarkMode insertBookmarkMode, ProgressMonitor monitor)
Inserts a range of pages from specified PDFDoc using PageSet
| ||||||||||
boolean |
isEncrypted()
Checks if PDFDoc is encrypted.
| ||||||||||
boolean |
isLinearized()
Call this function to determine whether the document is represented in
linearized (fast web view) format.
| ||||||||||
boolean |
isModified()
Call this function to determine whether the document has been modified
since it was last saved.
| ||||||||||
boolean |
isTagged()
Checks if current document is tagged.
| ||||||||||
void |
lock()
Locks the document to prevent competing threads from accessiong the
document at the same time.
| ||||||||||
void |
lockRead()
Locks the document to prevent competing write threads (using lock()) from accessing the document
at the same time.
| ||||||||||
void |
mergeXFDF(Filter xfdf_contents, String user_id)
Import form data from XFDF contents into this PDF.
| ||||||||||
void |
mergeXFDF(Filter xfdf_contents, MergeXFDFOptions opts)
Merge existing form and annotation data with those imported from the XFDF file.
| ||||||||||
void |
mergeXFDFString(String xfdf_contents, MergeXFDFOptions opts)
Merge existing form and annotation data with those imported from the XFDF file.
| ||||||||||
void |
mergeXFDFString(String xfdf_contents, String user_id)
Import form data from XFDF contents into this PDF.
| ||||||||||
void |
movePages(int moveBeforeThisPage, PDFDoc sourceDoc, PageSet sourcePageSet, int insertFlag, ProgressMonitor monitor)
This method is deprecated.
use
movePages(int, PDFDoc, PageSet, InsertBookmarkMode, ProgressMonitor) instead.
Moves a range of pages from specified PDFDoc. Pages are deleted from
source document after move.
Note: MovePages function does not save sourceDoc. It merely delete pages in memory. For permanent changes, PDFDoc::Save should be used to save sourceDoc after function exists. | ||||||||||
void |
movePages(int moveBeforeThisPage, PDFDoc sourceDoc, PageSet sourcePageSet, PDFDoc.InsertBookmarkMode insertBookmarkMode, ProgressMonitor monitor)
Moves a range of pages from specified PDFDoc.
| ||||||||||
void |
movePages(int moveBeforeThisPage, PDFDoc sourceDoc, int startPage, int endPage, PDFDoc.InsertBookmarkMode insertBookmarkMode, ProgressMonitor monitor)
Moves a range of pages from specified PDFDoc.
| ||||||||||
void |
movePages(int moveBeforeThisPage, PDFDoc sourceDoc, int startPage, int endPage, int insertFlag, ProgressMonitor monitor)
This method is deprecated.
use #movePages(int, PDFDoc, PDFDoc, int, int, InsertBookmarkMode, ProgressMonitor) instead.
Moves a range of pages from specified PDFDoc. Pages are deleted from
source document after move.
Note: MovePages function does not save sourceDoc. It merely delete pages in memory. For permanent changes, PDFDoc::Save should be used to save sourceDoc after function exists. | ||||||||||
Page |
pageCreate(Rect media_box)
Create page with given media box
| ||||||||||
Page |
pageCreate()
Create a new, empty page in the document.
| ||||||||||
void |
pageInsert(PageIterator where, Page page)
Insert/Import a single page at a specific location in the page sequence.
| ||||||||||
void |
pagePushBack(Page page)
Adds a page to the end of a documents's page sequence.
| ||||||||||
void |
pagePushFront(Page page)
Adds a page to the beginning of a documents's page sequence.
| ||||||||||
void |
pageRemove(PageIterator page_itr)
Remove specified page
| ||||||||||
void |
refreshAnnotAppearances(RefreshOptions opts)
Generates the appearance stream for annotations in the document using the specified options.
| ||||||||||
void |
refreshAnnotAppearances()
Generates the appearance stream for annotations in the document using the default options.
| ||||||||||
void |
refreshFieldAppearances()
Regenerates the appearance stream for every widget annotation in the
document Call this method if you modified field's value and would like to
update field's appearances.
| ||||||||||
void |
removePageLabel(int page_num)
Removes the page label that is attached to the specified page,
effectively merging the specified range with the previous page label
sequence.
| ||||||||||
void |
removeSecurity()
Removes all security for the document.
| ||||||||||
void |
removeSignatureHandler(long signature_handler_id)
Removes a signature handler from the signature manager.
| ||||||||||
void |
save(Filter output_filter, long flags)
This method is deprecated.
use
save(Filter, SDFDoc.SaveMode) instead.
Saves the document to a CustomFilter.
Note: Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save. | ||||||||||
void |
save(OutputStream stream, SaveMode[] saveModes, ProgressMonitor progress)
Saves the document to an OutputStream.
| ||||||||||
byte[] |
save(SaveMode[] saveModes, ProgressMonitor progress)
Saves the document to a memory buffer.
| ||||||||||
void |
save(long flags)
This method is deprecated.
use
save() instead.
Saves the document incrementally to the same location as it was opened from.
This function only works if the PDFDoc was opened using a FileDescriptorFilter.
Note: If the original pdf has a corrupt xref table (see HasRepairedXref or http://www.pdftron.com/kb_corrupt_xref), then this save can not be used. | ||||||||||
byte[] |
save(SDFDoc.SaveMode saveMode, ProgressMonitor progress)
Saves the document to a memory buffer.
| ||||||||||
byte[] |
save(long flags, ProgressMonitor progress)
This method is deprecated.
use
save(SDFDoc.SaveMode, ProgressMonitor) instead.
Saves the document to a memory buffer.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save. | ||||||||||
void |
save(OutputStream stream, SDFDoc.SaveMode saveMode, ProgressMonitor progress, int size)
Saves the document to an OutputStream.
| ||||||||||
void |
save(OutputStream stream, long flags, ProgressMonitor progress)
This method is deprecated.
use
save(OutputStream, SDFDoc.SaveMode, ProgressMonitor) instead.
Saves the document to an OutputStream.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save. | ||||||||||
void |
save(OutputStream stream, SDFDoc.SaveMode saveMode, ProgressMonitor progress)
Saves the document to an OutputStream.
| ||||||||||
void |
save(OutputStream stream, long flags, ProgressMonitor progress, int size)
This method is deprecated.
use
save(OutputStream, SDFDoc.SaveMode, ProgressMonitor, int) instead.
Saves the document to an OutputStream.
Note: - Save will modify the PDFDoc object's internal representation. As such,
the user should acquire a write lock before calling save.
| ||||||||||
void |
save(String path, long flags, ProgressMonitor progress)
This method is deprecated.
use
save(String, SDFDoc.SaveMode, ProgressMonitor) instead.
Saves the document to a file.
If a full save is requested to the original path, the file is saved to a
file system-determined temporary file, the old file is deleted, and the
temporary file is renamed to path.
A full save with remove unused or linearization option may re-arrange
object in the cross reference table. Therefore all pointers and
references to document objects and resources should be re acquired in
order to continue document editing.
In order to use incremental save the specified path must match original
path and e_incremental flag bit should be set.
Note: In a multi-threaded environment, the user is expected to acquire a write lock before attempting to save the document. Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save. Note: - If the original pdf has a corrupt xref table (see HasRepairedXref or http://www.pdftron.com/kb_corrupt_xref), then it can not be saved using the e_incremental flag. | ||||||||||
void |
save(String path, SaveMode[] saveModes, ProgressMonitor progress)
Saves the document to a file.
| ||||||||||
void |
save(String path, SDFDoc.SaveMode saveMode, ProgressMonitor progress)
Saves the document to a file.
| ||||||||||
void |
save(Filter output_filter, SDFDoc.SaveMode saveMode)
Saves the document to a CustomFilter.
| ||||||||||
void |
save(OutputStream stream, SaveMode[] saveModes, ProgressMonitor progress, int size)
Saves the document to an OutputStream.
| ||||||||||
void |
save()
Saves the document incrementally to the same location as it was opened from.
| ||||||||||
void |
save(Filter output_filter, SaveMode[] saveModes)
Saves the document to a file.
| ||||||||||
void |
saveCustomSignature(byte[] in_signature, DigitalSignatureField in_field, Filter output_filter)
Saves a custom signature Contents to a document which has been prepared to receive it.
| ||||||||||
void |
saveCustomSignature(byte[] in_signature, DigitalSignatureField in_field, String in_path)
Saves a custom signature Contents to a document which has been prepared to receive it.
| ||||||||||
boolean |
saveIncrementalData(String path)
Saves only the incremental portion of the PDFDoc to path
Works like saving using
INCREMENTAL but only
writes the portion that would have been appended to path. | ||||||||||
void |
saveViewerOptimized(String path, ViewerOptimizedOptions opts)
Applies optimizations to improve viewing speed and saves the document to the specified file.
| ||||||||||
byte[] |
saveViewerOptimized(ViewerOptimizedOptions opts)
Applies optimizations to improve viewing speed and saves the document to a memory buffer.
| ||||||||||
void |
setOpenAction(Action action)
Set the Action that will be triggered when the document is opened.
| ||||||||||
void |
setPageLabel(int page_num, PageLabel label)
Attaches a label to a page.
| ||||||||||
void |
setSecurityHandler(SecurityHandler handler)
The function sets a new SecurityHandler as the current security handler.
| ||||||||||
boolean |
timedLock(int milliseconds)
Try locking the document, waiting no longer than specified number of
milliseconds.
| ||||||||||
boolean |
timedLockRead(int milliseconds)
Tries to obtain a read lock the document for milliseconds duration, and returns
true if the lock was successfully acquired
| ||||||||||
boolean |
tryLock()
Try locking the document in non-blocking manner.
| ||||||||||
boolean |
tryLockRead()
Try obtaining a read lock on the document in non-blocking manner.
| ||||||||||
void |
unlock()
Unlock the document.
| ||||||||||
void |
unlockRead()
Removes the read lock from the document.
| ||||||||||
PDFDoc.SignaturesVerificationStatus |
verifySignedDigitalSignatures(VerificationOptions in_opts)
Attempts to verify all signed cryptographic digital signatures in the document, ignoring unsigned signatures.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.sdf.Doc
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
This constant is deprecated.
use DOC_DID_PRINT
instead.
Triggered after printing a document
This constant is deprecated.
use DOC_DID_SAVE
instead.
Triggered after saving a document
This constant is deprecated.
use DOC_WILL_CLOSE
instead.
Triggered before closing a document
This constant is deprecated.
use ActionTriggerMode#DOC_will_PRINT instead.
Triggered before printing a document
This constant is deprecated.
use DOC_WILL_SAVE
instead.
Triggered before saving a document
This constant is deprecated.
use NONE
instead.
do not insert bookmark
Create a PDF document from an existing SDF/Cos document.
Note: the SDFDoc will become invalid. If you would like to access the low level document use GetSDFDoc
sdfdoc | a pointer to the SDF document. Created PDFDoc will take the ownership of the low-level document. |
---|
PDFNetException |
---|
Open an existing PDF document.
Note: Make sure to call InitSecurityHandler() after PDFDoc(...) in case a document is encrypted
filepath | - pathname to the file. |
---|
PDFNetException |
---|
Open an existing PDF document.
Note: if the input stream doesn't support Seek() operation the document will load whole data stream in memory before parsing. In case of linearized PDF, the document may be parsed on-the-fly while it is being loaded in memory. Note that since StdFile implements Seek() interface, the document does not have to be fully in memory before it is used.
Note: Make sure to call InitSecurityHandler() after PDFDoc(...) for encrypted documents.
stream | - input stream containing a serialized document. The input stream may be a random-access file, memory buffer, slow HTTP connection etc. |
---|
PDFNetException |
---|
Open a SDF/Cos document from a memory buffer.
Note: the document should be fully loaded in the memory buffer.
buf | - a memory buffer containing the serialized document |
---|
PDFNetException |
---|
Open an existing PDF document from an InputStream.
Note: Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream | - input stream containing a serialized document. |
---|
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Open an existing PDF document from an InputStream.
Note: Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream | - input stream containing a serialized document. |
---|---|
size | - the expected size of the input stream. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Associates a file attachment with the document. The file attachment will be displayed in the user interface of a viewer application (in Acrobat this is File Attachment tab). The function differs from Annot.CreateFileAttachment() because it associates the attachment with the whole document instead of an annotation on a specific page.
Note: Another way to associate a file attachment with the document is using SDF::NameTree: {@code SDF.NameTree names = SDF.NameTree.Create(doc, "EmbeddedFiles"); names.put(file_key, file_keysz, embedded_file.GetSDFObj());
file_key | A key/name under which the attachment will be stored. |
---|---|
embedded_file | the embedded file |
PDFNetException | } |
---|
AddHighlights is used to highlight text in a document using 'Adobe's Highlight File Format' (Technical Note #5172 ). The method will parse the character offset data and modify the current document by adding new highlight annotations.
hilite | filename for the highlight file or a data buffer containing XML data. |
---|
Adds/links the specified Bookmark to the root level of document's outline tree.
root_bookmark | root bookmark. It must not be linked (must not be belong) to a bookmark tree. |
---|
PDFNetException |
---|
Adds a signature handler to the signature manager. There can only be one signature handler of a given name that can exist in the signature manager. A signature handler which name already exists in the signature manager cannot be added.
signature_handler | The signature handler instance to add to the signature manager. |
---|
PDFNetException |
---|
Adds a standard (built-in) signature handler to the signature manager. This method will use cryptographic algorithm based on Adobe.PPKLite/adbe.pkcs7.detached filter to sign a PDF.
pkcs12_keybuffer | The private key certificate store to use. (As an array of bytes). |
---|---|
pkcs12_keypass | The passphrase for the provided private key. |
PDFNetException |
---|
Adds a standard (built-in) signature handler to the signature manager. This method will use cryptographic algorithm based on Adobe.PPKLite/adbe.pkcs7.detached filter to sign a PDF.
pkcs12_keyfile | The private key certificate store to use. |
---|---|
pkcs12_keypass | The passphrase for the provided private key. |
PDFNetException |
---|
Imports two external PDFs and highlights the differences between them. This function appends alternating pages from the two input documents into the current document. Note: Each contiguous block of change is considered a single difference. A deletion immediately followed by an insertion is considered a single edit.
doc1 | is the before document, the basis of the comparison (read-only) |
---|---|
doc2 | is the after document, to which the basis is compared (read-only) |
PDFNetException |
---|
Imports two external PDFs and highlights the differences between them. This function appends alternating pages from the two input documents into the current document. Note: Each contiguous block of change is considered a single difference. A deletion immediately followed by an insertion is considered a single edit.
doc1 | is the before document, the basis of the comparison (read-only) |
---|---|
doc2 | is the after document, to which the basis is compared (read-only) |
options | processing options (optional) |
PDFNetException |
---|
Imports two external pages and highlights the differences between them. This function adds two new pages to the current document. The two input pages are typically coming from two different PDF files. Note: Each contiguous block of change is considered a single difference. A deletion immediately followed by an insertion is considered a single edit.
page1 | is the before page, the basis of the comparison (read-only) |
---|---|
page2 | is the after page, to which the basis is compared (read-only) |
PDFNetException |
---|
Generates a PDF diff of the given pages by overlaying and blending them on top of each other, then appends that diff as a new page in this document.
PDFNetException |
---|
Creates an unsigned digital signature form field inside the document.
in_sig_field_name | The fully-qualified name to give the digital signature field. If one is not provided, a unique name is created automatically. |
---|
PDFNetException |
---|
Create SDF/Cos indirect name Unlike direct objects, indirect objects can be referenced by more than one object (i.e. indirect objects they can be shared).
PDFNetException |
---|
Create the indirect string from buffer
value | input buffer |
---|
PDFNetException |
---|
Create the indirect string.
str | value of the indirect string |
---|
PDFNetException |
---|
Extract form data and/or annotations to FDF
extractFlag | specifies extract options |
---|
PDFNetException |
---|
Extract annotations to FDF
annotations | specifies the array of annotations |
---|
PDFNetException |
---|
Extract form data and/or annotations to FDF
pageToExtract | the set of pages for which to extract interactive data |
---|---|
extractFlag | specifies extract options |
PDFNetException |
---|
Extract form data to FDF
PDFNetException |
---|
Extract annotations to FDF
annot_list | specifies the array of annotations |
---|
PDFNetException |
---|
Extract annotations to FDF
annot_added | specifies the array of added annotations |
---|---|
annot_modified | specifies the array of modified annotations |
annot_deleted | specifies the array of deleted annotations |
PDFNetException |
---|
Import form data from FDF file to PDF interactive form.
fdf_doc | - a pointer to the FDF file |
---|
PDFNetException |
---|
Replace existing form and annotation data with those imported from the FDF file. It will make annotations in the FDF match those in the PDF. Since this method avoids updating annotations unnecessarily it works well with incremental save and can sometimes preserve annotation appearances, but it requires that the annotations intended to be in the final document be in the provided FDF file.
Note: Some PDF viewers (like Chrome) cannot display annotations that don't already have an appearance, so it is often desirable to call PDFDoc.RefreshAnnotAppearances after this method to ensure these annotations can still be displayed in those applications.
Note: This method is not suitable for realtime collaboration.
fdf_doc | - a pointer to the FDF file |
---|
PDFNetException |
---|
Create a new interactive form field
field_name | name of the field (e.g. "employee.name.first"). field_name must be either a unique name or equal to an existing terminal field name. |
---|---|
type | field type (e.g. Field::e_text, Field::e_button, etc.) |
PDFNetException |
---|
Create a new interactive form field
field_name | name of the field (e.g. "employee.name.first"). field_name must be either a unique name or equal to an existing terminal field name. |
---|---|
type | field type (e.g. Field::e_text, Field::e_button, etc.) |
PDFNetException |
---|
Create a new interactive form Field.
field_name | name of the field (e.g. "employee.name.first"). field_name must be either a unique name or equal to an existing terminal field name. |
---|---|
type | field type (e.g. Field::e_text, Field::e_button, etc.) |
PDFNetException |
---|
Create a new interactive form field
field_name | name of the field (e.g. "employee.name.first"). field_name must be either a unique name or equal to an existing terminal field name. |
---|---|
type | field type (e.g. Field::e_text, Field::e_button, etc.) |
PDFNetException |
---|
Create a new interactive form field
field_name | name of the field (e.g. "employee.name.first"). field_name must be either a unique name or equal to an existing terminal field name. |
---|---|
type | field type (e.g. Field::e_text, Field::e_button, etc.) |
PDFNetException |
---|
Flatten all annotations in the document.
forms_only | if false flatten all annotations, otherwise flatten only form fields. |
---|
PDFNetException |
---|
This method is deprecated.
use flattenAnnotationsAdvanced(FlattenMode[])
instead.
Flatten annotations/forms/links in the document.
flags | - A bit field composed of an OR of the following values: |
---|
PDFNetException |
---|
Flatten annotations/forms/links in the document.
flattenModes | An array of flatten modes (See PDFDoc.FlattenMode ). |
---|
PDFNetException |
---|
Generates thumbnail images for all the pages in this PDF document.
size | The maximum dimension (width or height) that thumbnails will have. |
---|
PDFNetException |
---|
Get the AcroForm Dictionary.
PDFNetException |
---|
Retrieves an iterator that iterates over digital signature fields.
PDFNetException |
---|
Retrieves the most restrictive document permissions locking level from all of the signed digital signatures in the document.
PDFNetException |
---|
Get the document infomation
PDFNetException |
---|
Returns the number of bytes that have been downloaded, when `hasDownloader()` is True.
PDFNetException | if 'hasDownloader()` returns False, calling this method will result in an exception. |
---|
Get the specified field from field name
field_name | - name of the field (e.g. "employee.name.first"). |
---|
PDFNetException |
---|
Get specified FieldIterator from field name
field_name | - name of the field (e.g. "employee.name.first"). |
---|
PDFNetException | FieldIterator itr = pdfdoc.getFieldIterator("name"); if (itr.hasNext()) {
string name = itr.current().getName()); else { ...field was not
found... }
}
|
---|
An interactive form (sometimes referred to as an AcroForm) is a collection of fields for gathering information interactively from the user. A PDF document may contain any number of fields appearing on any combination of pages, all of which make up a single, global interactive form spanning the entire document. The following methods are used to access and manipulate Interactive form fields (sometimes referred to as AcroForms).
PDFNetException | FieldIterator itr = pdfdoc.getFieldIterator(); for(; itr.hasNext();
itr.next()) { Field field = itr.current(); string s =
field.getName(); //For a full sample, please refer to
'InteractiveForms' sample project.
}
|
---|
Get the file name.
PDFNetException |
---|
Get the first bookmark.
PDFNetException |
---|
Get the optional group configuration
PDFNetException |
---|
Get the optional content groups
PDFNetException |
---|
Get the open action.
Note: if the document does not nave associated action the returned Action will be null (i.e. Action.IsValid() returns false)
PDFNetException |
---|
Get the page object from given page number
page_number | - the page number in document's page sequence. Page numbers in document's page sequence are indexed from 1. |
---|
PDFNetException | Page page = pdfdoc.GetPage(page_num); if (page == null) return; //
Page not found
|
---|
Get the page iterator from given page number
page_number | the input page number |
---|
PDFNetException |
---|
Get the page iterator.
PDFNetException | PageIterator itr = pdfdoc.getPageIterator(); while (itr.hasNext())
{ // Read every page Page page = itr.current(); // ... itr.next()
For full sample code, please take a look at ElementReader,
PDFPageTest and PDFDraw sample projects.
}
|
---|
Get the specified page label
page_num | The page number. Because PDFNet indexes pages starting from 1, page_num must be larger than 0. |
---|
PDFNetException |
---|
Get the pages.
PDFNetException |
---|
Get the root of the document
PDFNetException |
---|
Get the security handler.
Note: InitSecurityHandler() should be called before GetSecurityHandler() in order to initialize the handler.
Note: Returned security handler can be modified in order to change the security settings of the existing document. Changes to the current handler will not invalidate the access to the original file and will take effect during document Save().
Note: If the security handler is modified, document will perform a full
save even if INCREMENTAL
was given in Save() method.
Gets the associated signature handler instance from the signature manager by looking it up with the handler name. The returned signature handler instance is still owned by the signature manage if found.
signature_handler_id | The name of the signature handler to get. |
---|
PDFNetException |
---|
Get the structure tree root
PDFNetException |
---|
Returns the document's total size in bytes, when `HasDownloader()` is True.
PDFNetException | if 'hasDownloader()` returns False, calling this method will result in an exception. |
---|
Get the document's trailer.
PDFNetException |
---|
Get the Action associated with the selected PDFDoc Trigger event.
triggerMode | the type of trigger event to get (See PDFDoc.ActionTriggerMode ) |
---|
PDFNetException |
---|
This method is deprecated.
use INCREMENTAL
instead.
Get the Action associated with the selected PDFDoc Trigger event.
trigger | the type of trigger event to get |
---|
PDFNetException |
---|
Get the view preferences
PDFNetException |
---|
Call this function to determine whether the document has been modified since the last Undo/Redo snapshot was taken
PDFNetException |
---|
Indicates whether this document was created via the `PDFViewCtrl` method `OpenURLAsync`.
PDFNetException |
---|
Checks for optional content
PDFNetException |
---|
Checks whether or not the underlying file has an XRef table that had to be repaired when the file was opened. If the document had an invalid XRef table when opened, PDFNet will have repaired the XRef table for its working representation of the document. Note: If this function returns true, it is not possible to incrementally save the document (see http://www.pdftron.com/kb_corrupt_xref)
PDFNetException |
---|
Indicates whether this documents contains any digital signatures.
Highlights the differences between the external PDFs. The highlights are added directly to the inputs. This function directly adds the highlights to the two input documents. Note: Each contiguous block of change is considered a single difference. A deletion immediately followed by an insertion is considered a single edit.
doc1 | is the before document, the basis of the comparison |
---|---|
doc2 | is the after document, to which the basis is compared |
options | processing options (optional) |
PDFNetException |
---|
Import given pages into current PDFDoc
pages | pages to import |
---|---|
import_bookmarks | whether to import bookmarks |
PDFNetException |
---|
The function imports a list of pages to this documents. Although a list of pages can be imported using repeated calls to PageInsert(), PageImport will not import duplicate copies of resources that are shared across pages (such as fonts, images, colorspaces etc). Therefore this method is recommended when a page import list consists of several pages that share the same resources.
pages | A list of pages to import. All pages should belong to the same source document. |
---|
PDFNetException |
---|
Initialize the security handler.
custom_data | specify custom data that should be passed in SecurityHandler::Initialize() callback. |
---|
PDFNetException |
---|
Initializes document's SecurityHandler. This version of InitSecurityHandler() works with Standard and Custom PDF security and can be used in situations where the password is obtained dynamically via user feedback. See EncTest sample for example code. This function should be called immediately after an encrypted document is opened. The function does not have any side effects on documents that are not encrypted. If the security handler was successfully initialized it can be later obtained using GetSecurityHandler() method.
PDFNetException |
---|
Initializes document's SecurityHandler using the supplied password. This version of InitSecurityHandler() assumes that document uses Standard security and that a password is specified directly. This function should be called immediately after an encrypted document is opened. The function does not have any side effects on documents that are not encrypted. If the security handler was successfully initialized, it can be later obtained using GetSecurityHandler() method.
password | Specifies the password used to open the document without any user feedback. If you would like to dynamically obtain the password, you need to derive a custom class from StdSecurityHandler() and use InitSecurityHandler() without any parameters. See EncTest sample for example code. |
---|
PDFNetException |
---|
Initializes document's SecurityHandler using the supplied password. This version of InitSecurityHandler() assumes that document uses Standard security and that a password is specified directly. This function should be called immediately after an encrypted document is opened. The function does not have any side effects on documents that are not encrypted. If the security handler was successfully initialized, it can be later obtained using GetSecurityHandler() method.
passwordBuffer | Specifies the password used to open the document without any user feedback. If you would like to dynamically obtain the password, you need to derive a custom class from StdSecurityHandler() and use InitSecurityHandler() without any parameters. See EncTest sample for example code. |
---|
PDFNetException |
---|
This method is deprecated.
use insertPages(int, PDFDoc, int, int, InsertBookmarkMode, ProgressMonitor)
instead.
Inserts a range of pages from specified PDFDoc
insertBeforeThisPage | the destination of the insertion. If less than or equal to 1, the pages are added to the beginning of the document. If larger than the number of pages in the destination document, the pages are appended to the document. |
---|---|
sourceDoc | source PDFDoc to insert from |
startPage | start of the page number to insert |
endPage | end of the page number to insert |
insertFlag | specifies insert options |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Inserts a range of pages from specified PDFDoc
insertBeforeThisPage | the destination of the insertion. If less than or equal to 1, the pages are added to the beginning of the document. If larger than the number of pages in the destination document, the pages are appended to the document. |
---|---|
sourceDoc | source PDFDoc to insert from |
startPage | start of the page number to insert |
endPage | end of the page number to insert |
insertBookmarkMode | specifies insert bookmark option (See PDFDoc.InsertBookmarkMode ) |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
This method is deprecated.
use insertPages(int, PDFDoc, PageSet, InsertBookmarkMode, ProgressMonitor)
instead.
Inserts a range of pages from specified PDFDoc using PageSet
insertBeforeThisPage | the destination of the insertion. If less than or equal to 1, the pages are added to the beginning of the document. If larger than the number of pages in the destination document, the pages are appended to the document. |
---|---|
sourceDoc | source PDFDoc to insert from |
sourcePageSet | a collection of the page number to insert |
insertFlag | specifies insert options |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Inserts a range of pages from specified PDFDoc using PageSet
insertBeforeThisPage | the destination of the insertion. If less than or equal to 1, the pages are added to the beginning of the document. If larger than the number of pages in the destination document, the pages are appended to the document. |
---|---|
sourceDoc | source PDFDoc to insert from |
sourcePageSet | a collection of the page number to insert |
insertBookmarkMode | specifies insert option (See PDFDoc.InsertBookmarkMode ) |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Checks if PDFDoc is encrypted.
PDFNetException |
---|
Call this function to determine whether the document is represented in linearized (fast web view) format.
Note: Any changes to the document can invalidate linearization. The function will return 'true' only if the original document is linearized and if it is not modified.
In order to provide good performance over relatively slow communication links, PDFNet can generate PDF documents with linearized objects and hint tables that can allow a PDF viewer application to download and view one page of a PDF file at a time, rather than requiring the entire file (including fonts and images) to be downloaded before any of it can be viewed.
To save a document in linearized (fast web view) format you only
need to pass LINEARIZED
mode in the Save.
method.
PDFNetException |
---|
Call this function to determine whether the document has been modified since it was last saved.
PDFNetException |
---|
Checks if current document is tagged.
Locks the document to prevent competing threads from accessiong the document at the same time. Threads attempting to access the document will wait in suspended state until the thread that owns the lock calls doc.Unlock().
PDFNetException |
---|
Locks the document to prevent competing write threads (using lock()) from accessing the document at the same time. Other reader threads however, will be allowed to access the document. Threads attempting to obtain write access to the document will wait in suspended state until the thread that owns the lock calls doc.unlockRead(). Note: To avoid deadlocks obtaining a write lock while holding a read lock is not permitted and will throw an exception. If this situation is encountered please either unlock the read lock before the write lock is obtained or acquire a write lock (rather than read lock) in the first place.
PDFNetException |
---|
Import form data from XFDF contents into this PDF.
xfdf_contents | - Input Filter which provides the xfdf contents |
---|---|
user_id | - The id of the user who is permitting the modifications. This serves to restrict the modifications made to the document, as only annotations with the same user_id can be modified. An empty string allows all modifications. |
PDFNetException |
---|
Merge existing form and annotation data with those imported from the XFDF file. It will replace annotations from pdfdocument with matching annotations from XFDF. In order for the annotations to be considered matching, "name" of the xfdf annotation needs to match "NM" of that in pdf. XFDF annotations that don't have a match in the pdf document will be added. For regular xfdf files, no deletions will be made This method also supports command form of xfdf, for those files, deletions will be performed for annotations in "delete" section Since this method avoids updating annotations unnecessarily it works well with incremental save. Note: This method is suitable for realtime collaboration.
xfdf_contents | - Input Filter which provides the xfdf contents |
---|---|
opts | - MergeXFDFOptions object for finer control |
PDFNetException |
---|
Merge existing form and annotation data with those imported from the XFDF file. It will replace annotations from pdfdocument with matching annotations from XFDF. In order for the annotations to be considered matching, "name" of the xfdf annotation needs to match "NM" of that in pdf. XFDF annotations that don't have a match in the pdf document will be added. For regular xfdf files, no deletions will be made This method also supports command form of xfdf, for those files, deletions will be performed for annotations in "delete" section Since this method avoids updating annotations unnecessarily it works well with incremental save. Note: This method is suitable for realtime collaboration.
xfdf_contents | - xfdf contents in string form or the path to the xfdf file |
---|---|
opts | - MergeXFDFOptions object for finer control |
PDFNetException |
---|
Import form data from XFDF contents into this PDF.
xfdf_contents | - xfdf contents in string form |
---|---|
user_id | - The id of the user who is permitting the modifications. This serves to restrict the modifications made to the document, as only annotations with the same user_id can be modified. An empty string allows all modifications. |
PDFNetException |
---|
This method is deprecated.
use movePages(int, PDFDoc, PageSet, InsertBookmarkMode, ProgressMonitor)
instead.
Moves a range of pages from specified PDFDoc. Pages are deleted from
source document after move.
Note: MovePages function does not save sourceDoc. It merely delete pages in memory. For permanent changes, PDFDoc::Save should be used to save sourceDoc after function exists.
moveBeforeThisPage | the destination of the move. If less than or equal to 1, the pages are moved to the beginning of the document. If larger than the number of pages in the destination document, the pages are moved to the end of document. |
---|---|
sourceDoc | source PDFDoc to move from |
sourcePageSet | a collection of the page number to move |
insertFlag | specifies insert options |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Moves a range of pages from specified PDFDoc. Pages are deleted from source document after move.
Note: MovePages function does not save sourceDoc. It merely delete pages in memory. For permanent changes, PDFDoc::Save should be used to save sourceDoc after function exists.
moveBeforeThisPage | the destination of the move. If less than or equal to 1, the pages are moved to the beginning of the document. If larger than the number of pages in the destination document, the pages are moved to the end of document. |
---|---|
sourceDoc | source PDFDoc to move from |
sourcePageSet | a collection of the page number to move |
insertBookmarkMode | specifies insert option (See PDFDoc.InsertBookmarkMode ) |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Moves a range of pages from specified PDFDoc. Pages are deleted from source document after move.
Note: MovePages function does not save sourceDoc. It merely delete pages in memory. For permanent changes, PDFDoc::Save should be used to save sourceDoc after function exists.
moveBeforeThisPage | the destination of the move. If less than or equal to 1, the pages are moved to the beginning of the document. If larger than the number of pages in the destination document, the pages are moved to the end of document. |
---|---|
sourceDoc | source PDFDoc to move from |
startPage | start of the page number to move |
endPage | end of the page number to move |
insertBookmarkMode | specifies insert option (See PDFDoc.InsertBookmarkMode ) |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
This method is deprecated.
use #movePages(int, PDFDoc, PDFDoc, int, int, InsertBookmarkMode, ProgressMonitor) instead.
Moves a range of pages from specified PDFDoc. Pages are deleted from
source document after move.
Note: MovePages function does not save sourceDoc. It merely delete pages in memory. For permanent changes, PDFDoc::Save should be used to save sourceDoc after function exists.
moveBeforeThisPage | the destination of the move. If less than or equal to 1, the pages are moved to the beginning of the document. If larger than the number of pages in the destination document, the pages are moved to the end of document. |
---|---|
sourceDoc | source PDFDoc to move from |
startPage | start of the page number to move |
endPage | end of the page number to move |
insertFlag | specifies insert options |
monitor | A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Create page with given media box
media_box | the input media box |
---|
PDFNetException |
---|
Create a new, empty page in the document. You can use PageWriter to fill the page with new content. Finally the page should be inserted at specific place within document page sequence using PageInsert/PagePushFront/PagePushBack methods.
Note: the new page still does not belong to document page sequence and should be subsequently placed at a specific location within the sequence.
PDFNetException |
---|
Insert/Import a single page at a specific location in the page sequence.
Note: Invalidates all PageIterators pointing to the document.
where | - The location in the page sequence indicating where to insert the page. The page is inserted before the specified location. |
---|---|
page | - A page to insert. |
PDFNetException |
---|
Adds a page to the end of a documents's page sequence.
Note: Invalidates all PageIterators pointing to the document.
page | - a page to append to the document |
---|
PDFNetException |
---|
Adds a page to the beginning of a documents's page sequence.
page | - a page to prepend to the document Invalidates all PageIterators pointing to the document. |
---|
PDFNetException |
---|
Remove specified page
page_itr | - the PageIterator to the page that should be removed A PageIterator for the given page can be obtained using PDFDoc::Find(page_num) or using direct iteration through document's page sequence. |
---|
PDFNetException |
---|
Generates the appearance stream for annotations in the document using the specified options. A common use case is to generate appearances only for missing annotations, which can be accomplished using the default options.
PDFNetException |
---|
Generates the appearance stream for annotations in the document using the default options. A common use case is to generate appearances only for missing annotations, which can be accomplished using the default options.
PDFNetException |
---|
Regenerates the appearance stream for every widget annotation in the document Call this method if you modified field's value and would like to update field's appearances.
PDFNetException |
---|
Removes the page label that is attached to the specified page, effectively merging the specified range with the previous page label sequence.
page_num | The page from which the page label is removed. Because PDFNet indexes pages starting from 1, page_num must be larger than 0. |
---|
PDFNetException |
---|
Removes all security for the document.
Removes a signature handler from the signature manager.
signature_handler_id | The unique id of the signature handler to remove. |
---|
PDFNetException |
---|
This method is deprecated.
use save(Filter, SDFDoc.SaveMode)
instead.
Saves the document to a CustomFilter.
Note: Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
output_filter | A output_filter filter where the document should be saved to. |
---|---|
flags | - A bit field composed of an OR of the following values: |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves the document to an OutputStream.
See save(OutputStream, SDFDoc.SaveMode, ProgressMonitor)
IOException | |
---|---|
PDFNetException |
Saves the document to a memory buffer.
See save(SDFDoc.SaveMode, ProgressMonitor)
PDFNetException |
---|
This method is deprecated.
use save()
instead.
Saves the document incrementally to the same location as it was opened from.
This function only works if the PDFDoc was opened using a FileDescriptorFilter.
Note: If the original pdf has a corrupt xref table (see HasRepairedXref or http://www.pdftron.com/kb_corrupt_xref), then this save can not be used.
flags | - [REMOVE] Must be e_incremental |
---|
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves the document to a memory buffer.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
saveMode | - save mode (See SDFDoc.SaveMode ). |
---|---|
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
This method is deprecated.
use save(SDFDoc.SaveMode, ProgressMonitor)
instead.
Saves the document to a memory buffer.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
flags | - A bit field composed of an OR of the following values: |
---|---|
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Saves the document to an OutputStream. Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | An OutputStream where the document should be serialized. |
---|---|
saveMode | - save mode (See SDFDoc.SaveMode ). |
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
size | The expected size of the output stream. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
This method is deprecated.
use save(OutputStream, SDFDoc.SaveMode, ProgressMonitor)
instead.
Saves the document to an OutputStream.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | An OutputStream where the document should be serialized. |
---|---|
flags | - A bit field composed of an OR of the following values: |
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves the document to an OutputStream.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | An OutputStream where the document should be serialized. |
---|---|
saveMode | - save mode (See SDFDoc.SaveMode ). |
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
This method is deprecated.
use save(OutputStream, SDFDoc.SaveMode, ProgressMonitor, int)
instead.
Saves the document to an OutputStream.
Note: - Save will modify the PDFDoc object's internal representation. As such,
the user should acquire a write lock before calling save.
stream | An OutputStream where the document should be serialized. |
---|---|
flags | - A bit field composed of an OR of the following values: |
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
size | The expected size of the output stream. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
This method is deprecated.
use save(String, SDFDoc.SaveMode, ProgressMonitor)
instead.
Saves the document to a file.
If a full save is requested to the original path, the file is saved to a
file system-determined temporary file, the old file is deleted, and the
temporary file is renamed to path.
A full save with remove unused or linearization option may re-arrange
object in the cross reference table. Therefore all pointers and
references to document objects and resources should be re acquired in
order to continue document editing.
In order to use incremental save the specified path must match original
path and e_incremental flag bit should be set.
Note: In a multi-threaded environment, the user is expected to acquire a write lock before attempting to save the document.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
Note: - If the original pdf has a corrupt xref table (see HasRepairedXref or http://www.pdftron.com/kb_corrupt_xref), then it can not be saved using the e_incremental flag.
path | - The full path name to which the file is saved. |
---|---|
flags | - A bit field composed of an OR of the following values: |
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Saves the document to a file.
See save(String, SDFDoc.SaveMode, ProgressMonitor)
PDFNetException |
---|
Saves the document to a file.
If a full save is requested to the original path, the file is saved to a
file system-determined temporary file, the old file is deleted, and the
temporary file is renamed to path.
A full save with remove unused or linearization option may re-arrange
object in the cross reference table. Therefore all pointers and
references to document objects and resources should be re acquired in
order to continue document editing.
In order to use incremental save the specified path must match original
path and INCREMENTAL
should be given.
Note: In a multi-threaded environment, the user is expected to acquire a write lock before attempting to save the document.
Note: - Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
Note: - If the original pdf has a corrupt xref table (see HasRepairedXref or
http://www.pdftron.com/kb_corrupt_xref), then it can not be saved using
the INCREMENTAL
mode.
path | - The full path name to which the file is saved. |
---|---|
saveMode | - save mode (See SDFDoc.SaveMode ). |
progress | - A pointer to the progress interface. NULL if progress tracking is not required. |
PDFNetException |
---|
Saves the document to a CustomFilter.
Note: Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
output_filter | A output_filter filter where the document should be saved to. |
---|---|
saveMode | - save mode (See SDFDoc.SaveMode ). |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves the document to an OutputStream.
See save(OutputStream, SDFDoc.SaveMode, ProgressMonitor, int)
IOException | |
---|---|
PDFNetException |
Saves the document incrementally to the same location as it was opened from.
Note: If the original pdf has a corrupt xref table (see HasRepairedXref or http://www.pdftron.com/kb_corrupt_xref), then this save can not be used.
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves the document to a file.
See save(Filter, SDFDoc.SaveMode)
IOException | |
---|---|
PDFNetException |
Saves a custom signature Contents to a document which has been prepared to receive it. No changes should be made to document in meantime. The output goes into a Filter.
Note: This method ignores e_incremental flag. Save will modify the PDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
in_signature | The signature Contents to write |
---|---|
in_field | The signature field to which to write |
output_filter | The output filter where to write data |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves a custom signature Contents to a document which has been prepared to receive it. No changes should be made to document in meantime. The output goes into a file at the provided path.
in_signature | The signature Contents to write |
---|---|
in_field | The signature field to which to write |
in_path | The full path name to which the file is saved. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Saves only the incremental portion of the PDFDoc to path
Works like saving using INCREMENTAL
but only
writes the portion that would have been appended to path.
path | - The full path name to which the incremental data is saved. |
---|
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Applies optimizations to improve viewing speed and saves the document to the specified file. The main optimizations used are linearization and embedding thumbnails for the first page and any complex pages.
path | The full path name to which the file is saved. |
---|---|
opts | The optimization options |
PDFNetException | - if the file can't be opened for saving or if there is a problem during Save an Exception object will be thrown. |
---|
Applies optimizations to improve viewing speed and saves the document to a memory buffer. The main optimizations used are linearization and embedding thumbnails for the first page and any other pages that are slow to render.
opts | The optimization options |
---|
PDFNetException | if the file can't be opened for saving or if there is a problem during Save an Exception object will be thrown. |
---|
Set the Action that will be triggered when the document is opened.
action | A new Action that will be triggered when the document is opened. An example of such action is a GoTo Action that takes the user to a given location in the document. |
---|
PDFNetException |
---|
Attaches a label to a page. This establishes the numbering scheme for that page and all following it, until another page label is encountered. This label allows PDF producers to define a page numbering system other than the default.
page_num | The number of the page to label. If page_num is less than 1 or greater than the number of pages in the document, the method does nothing. |
---|---|
label | page label input PageLabel |
PDFNetException |
---|
The function sets a new SecurityHandler as the current security handler.
Note: Setting a new security handler will not invalidate the access to the original file and will take effect during document Save().
Note: If the security handler is modified, document will perform a full
save even if INCREMENTAL
was given in Save() method.
handler | the new security handler |
---|
Try locking the document, waiting no longer than specified number of milliseconds.
milliseconds | maximum time to wait |
---|
PDFNetException |
---|
Tries to obtain a read lock the document for milliseconds duration, and returns true if the lock was successfully acquired
milliseconds | maximum time to wait |
---|
PDFNetException |
---|
Try locking the document in non-blocking manner.
PDFNetException |
---|
Try obtaining a read lock on the document in non-blocking manner.
PDFNetException |
---|
Attempts to verify all signed cryptographic digital signatures in the document, ignoring unsigned signatures.
PDFNetException |
---|