java.lang.Object | ||
↳ | com.pdftron.sdf.Doc | |
↳ | com.pdftron.sdf.SDFDoc |
SDFDoc is a low-level document representing a graph of SDF.Obj nodes that
can be used to build higher-level document models such as PDF (Portable Document
Format) or FDF (Forms Document Format).
SDF Doc brings together document security, document utility methods, and all SDF
objects.
A SDF document can be created from scratch using a default constructor:
SDFDoc mydoc = new SDFDoc();
Obj trailer = mydoc.getTrailer();
SDF document can be also created from an existing file (e.g. an external PDF document):
SDFDoc mydoc = new SDFDoc("in.pdf");
Obj trailer = mydoc.getTrailer();
or from a memory buffer or some other Filter/Stream such as a HTTP Filter connection:
MemoryFilter memory = ....
SDFDoc mydoc = new SDFDoc(memory);
Obj trailer = mydoc.getTrailer();
Finally SDF document can be accessed from a high-level PDF document as follows:
PDFDoc doc = new PDFDoc("in.pdf");
SDFDoc mydoc = doc.getSDFDoc();
Obj trailer = mydoc.getTrailer();
Note that the examples above used doc.GetTrailer() in order to access document
trailer, the starting SDF object (root node) in every document. Following the trailer
links, it is possible to visit all low-level objects in a document (e.g. all pages,
outlines, fonts, etc).
SDFDoc also provides utility methods used to import objects and object collections
from one document to another. These methods can be useful for copy operations between
documents such as a high-level page merge and document assembly.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | SDFDoc.SaveMode |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | e_compatibility |
This constant is deprecated.
use COMPATIBILITY instead.
|
|||||||||
int | e_hex_strings |
This constant is deprecated.
use HEX_STRINGS instead.
|
|||||||||
int | e_incremental |
This constant is deprecated.
use INCREMENTAL instead.
|
|||||||||
int | e_linearized |
This constant is deprecated.
use LINEARIZED instead.
|
|||||||||
int | e_omit_xref |
This constant is deprecated.
use OMIT_XREF instead.
|
|||||||||
int | e_remove_unused |
This constant is deprecated.
use REMOVE_UNUSED instead.
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SDFDoc()
Default constructor.
| |||||||||||
SDFDoc(String filepath)
Open a SDF/Cos document from a file.
| |||||||||||
SDFDoc(Filter stream)
Open a SDF/Cos document from a Filter (i.e.
| |||||||||||
SDFDoc(byte[] buf)
Open a SDF/Cos document from a memory buffer.
| |||||||||||
SDFDoc(InputStream stream)
Instantiates a new SDFDoc from stream.
| |||||||||||
SDFDoc(InputStream stream, int size)
Instantiates a new SDFDoc from stream with specified size.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static SDFDoc | __Create(long impl, Object ref) | ||||||||||
long | __GetHandle() | ||||||||||
Object | __GetRefHandle() | ||||||||||
void | __SetRef(Object ref) | ||||||||||
boolean |
canSaveToPath(String path, SDFDoc.SaveMode saveMode)
Checks if a path is valid for a planned save operation
| ||||||||||
boolean |
canSaveToPath(String path, long flags)
This method is deprecated.
use
canSaveToPath(String, SaveMode) instead.
Checks if a path is valid for a planned save operation | ||||||||||
void |
clearMarks()
Removes 'marked' flag from all objects in cross reference table.
| ||||||||||
void |
close()
Close SDFDoc and release resources
Frees the native memory of the object.
| ||||||||||
Obj |
createIndirectArray()
Create an indirect array.
| ||||||||||
Obj |
createIndirectBool(boolean value)
Create an indirect boolean
| ||||||||||
Obj |
createIndirectDict()
Create an indirect dictionary
| ||||||||||
Obj |
createIndirectName(String name)
The following list of methods is used to create SDF/Cos indirect objects.
| ||||||||||
Obj |
createIndirectNull()
Create an indirect null
| ||||||||||
Obj |
createIndirectNumber(double value)
Create an indirect number.
| ||||||||||
Obj |
createIndirectStream(byte[] data)
Create an indirect stream from buffer
| ||||||||||
Obj |
createIndirectStream(FilterReader data)
Create an indirect stream from FilterReader
| ||||||||||
Obj |
createIndirectStream(byte[] data, Filter filter_chain)
Create an indirect stream
| ||||||||||
Obj |
createIndirectStream(FilterReader data, Filter filter_chain)
Create an indirect stream from FilterReader
| ||||||||||
Obj |
createIndirectString(byte[] value)
Create an indirect string.
| ||||||||||
Obj |
createIndirectString(String str)
Create an indirect string.
| ||||||||||
void |
enableDiskCaching(boolean use_cache)
Enable or disable disk caching feature
Note: A document uses a temporary file which is used to cache the contents of any new stream object created in the document (that is the default behavior). | ||||||||||
String |
getFileName()
Get SDFDoc filename
| ||||||||||
String |
getHeader()
Get the file header.
| ||||||||||
Obj |
getHintStream()
Get document's initial linearization hint stream if it is available.
| ||||||||||
Obj |
getLinearizationDict()
Get document's initial linearization dictionary if it is available.
| ||||||||||
Obj |
getObj(long obj_num)
Get the Obj with specified object number
| ||||||||||
SecurityHandler |
getSecurityHandler()
Get the security handler.
| ||||||||||
Obj |
getTrailer()
Get root of the document as Obj
| ||||||||||
boolean |
hasRepairedXRef()
Checks whether or not the underlying file has an XRef table that had to be repaired
when the file was opened.
| ||||||||||
Obj |
importObj(Obj obj, boolean deep_copy)
Import obj to SDFDoc
Note: If the object belongs to a document the function will perform deep or shallow clone depending whether deep_copy flag was specified. | ||||||||||
Obj[] |
importObjs(Obj[] obj_list, Obj[] exclusion_list)
The function performs a deep copy of all objects specified in the 'obj_list'.
| ||||||||||
Obj[] |
importObjs(Obj[] obj_list)
The function performs a deep copy of all objects specified in the 'obj_list'.
| ||||||||||
boolean |
initSecurityHandler(Object custom_data)
Initializes document's SecurityHandler.
| ||||||||||
boolean |
initSecurityHandler()
Initializes document's SecurityHandler.
| ||||||||||
boolean |
initStdSecurityHandler(byte[] passwordBuffer)
Initializes document's SecurityHandler using the supplied
password.
| ||||||||||
boolean |
initStdSecurityHandler(String password)
Initializes document's SecurityHandler using the supplied
password.
| ||||||||||
boolean |
isEncrypted()
Checks if SDFDoc is encrypted.
| ||||||||||
boolean |
isFullSaveRequired()
Checks if is full save required.
| ||||||||||
boolean |
isLinearized()
Call this function to determine whether the document is represented in
linearized (fast web view) format.
| ||||||||||
boolean |
isModified()
Checks if SDFDoc is modified.
| ||||||||||
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 |
removeSecurity()
Removes all security from SDFDoc.
| ||||||||||
void |
save(String path, SDFDoc.SaveMode saveMode, ProgressMonitor progress, String header)
Saves the document to a file.
| ||||||||||
void |
save(OutputStream stream, SDFDoc.SaveMode saveMode, ProgressMonitor progress, String header, int size)
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. | ||||||||||
void |
save(OutputStream stream, long flags, ProgressMonitor progress, String header, int size)
This method is deprecated.
use
save(OutputStream, SaveMode, ProgressMonitor, String, int) instead.
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. As such, the user should acquire a write lock before calling save. | ||||||||||
byte[] |
save(long flags, ProgressMonitor progress, String header)
This method is deprecated.
use
save(SaveMode, ProgressMonitor, String) instead.
Saves the document to a memory buffer.
- Save will modify the SDFDoc object's internal representation. As such, the user should acquire a write lock before calling save. | ||||||||||
void |
save(String path, long flags, ProgressMonitor progress, String header)
This method is deprecated.
use
save(String, SaveMode, ProgressMonitor, String) 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: - Save will modify the SDFDoc 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. | ||||||||||
byte[] |
save(SDFDoc.SaveMode saveMode, ProgressMonitor progress, String header)
Saves the document to a memory buffer.
| ||||||||||
void |
save(OutputStream stream, long flags, ProgressMonitor progress, String header)
This method is deprecated.
use
save(OutputStream, SaveMode, ProgressMonitor, String) instead.
Save SDFDoc to output stream
- Save will modify the SDFDoc 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, String header)
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. | ||||||||||
void |
setSecurityHandler(SecurityHandler handler)
The function sets a new SecurityHandler as the current security handler.
| ||||||||||
void |
swap(long obj_num1, long obj_num2)
Sometimes it is desirable to modify all indirect references to a given
indirect object.
| ||||||||||
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 |
tryLockRead()
Try obtaining a read lock on the document in non-blocking manner.
| ||||||||||
void |
unlock()
Removes the lock from the document.
| ||||||||||
void |
unlockRead()
Removes the read lock from the document.
| ||||||||||
long |
xRefSize()
Get size of the cross reference table
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.sdf.Doc
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
This constant is deprecated.
use COMPATIBILITY
instead.
Saves the document in a manner that maximizes compatibility with older PDF consumers (e.g. the file will not use object and compressed xref streams).
This constant is deprecated.
use HEX_STRINGS
instead.
Save all string in hexadecimal format.
This constant is deprecated.
use INCREMENTAL
instead.
Save the document using incremental mode.
This constant is deprecated.
use LINEARIZED
instead.
Save the document in linearized (fast web-view) format. Requires full save.
This constant is deprecated.
use OMIT_XREF
instead.
Do not save cross-reference table
This constant is deprecated.
use REMOVE_UNUSED
instead.
Remove unused objects. Requires full save.
Default constructor. Creates a new document. The new document contains only trailer and Info dictionary. To build the rest of the document get document's root dictionary using GetTrailer() and populate it with new key/value pairs.
PDFNetException |
---|
Open a SDF/Cos document from a file.
Note: Make sure to call InitStdSecurityHandler() or InitSecurityHandler() after SDFDoc(...) in case the document is encrypted.
filepath | - path name to the file. |
---|
PDFNetException |
---|
Open a SDF/Cos document from a Filter (i.e. a data stream) object.
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.
Make sure to call InitStdSecurityHandler() or InitSecurityHandler() after SDFDoc(...) in case the document is encrypted.
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.
the buffer ownership is not transfered to the Document so the user should clean-up if necessary.
Make sure to call InitStdSecurityHandler() or InitSecurityHandler() after SDFDoc(...) in case the document is encrypted.
buf | - a memory buffer containing the serialized document |
---|
PDFNetException |
---|
Instantiates a new SDFDoc from stream.
stream | the input stream to create SDFDoc from |
---|
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Instantiates a new SDFDoc from stream with specified size.
stream | the input stream to create SDFDoc from |
---|---|
size | the size |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Checks if a path is valid for a planned save operation
PDFNetException |
---|
This method is deprecated.
use canSaveToPath(String, SaveMode)
instead.
Checks if a path is valid for a planned save operation
PDFNetException |
---|
Removes 'marked' flag from all objects in cross reference table.
PDFNetException |
---|
Close SDFDoc and release resources Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Create an indirect boolean
value | of the indirect boolean object |
---|
PDFNetException |
---|
The following list of methods is used to create SDF/Cos indirect objects. Unlike direct objects, indirect objects can be referenced by more than one object (i.e. indirect objects they can be shared).
name | the name |
---|
PDFNetException |
---|
Create an indirect number.
value | of the indirect number |
---|
PDFNetException |
---|
Create an indirect stream from buffer
data | input buffer |
---|
PDFNetException |
---|
Create an indirect stream from FilterReader
data | input FilterReader |
---|
PDFNetException |
---|
Create an indirect stream
data | input buffer |
---|---|
filter_chain | chain of filters |
PDFNetException |
---|
Create an indirect stream from FilterReader
data | input FilterReader |
---|---|
filter_chain | chain of filters |
PDFNetException |
---|
Create an indirect string.
value | of indirect string |
---|
PDFNetException |
---|
Create an indirect string.
str | value of indirect string |
---|
PDFNetException |
---|
Enable or disable disk caching feature
Note: A document uses a temporary file which is used to cache the contents of any new stream object created in the document (that is the default behavior).
use_cache | If true, this PDFDoc will use a temporary file to cache new content streams (this is the default behavior). |
---|
Get SDFDoc filename
PDFNetException |
---|
Get the file header.
PDFNetException |
---|
Get document's initial linearization hint stream if it is available.
PDFNetException |
---|
Get document's initial linearization dictionary if it is available.
PDFNetException |
---|
Get the Obj with specified object number
obj_num | object number of the object to retrieve. |
---|
PDFNetException |
---|
Get the security handler.
Note: InitSecurityHandler() should be called before GetSecurityHandler() in order to initialize the handler.
Returned security handler can be modified in order to change the security settings of the exisitng document. Changes to the current handler will not invalidate the access to the original file and will take effect during document Save().
If the security handler is modified, document will perform a full save
even if INCREMENTAL
was given in Save() method.
Get root of the document as Obj
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 |
---|
Import obj to SDFDoc
Note: If the object belongs to a document the function will perform deep or shallow clone depending whether deep_copy flag was specified. If the object does not belong to any document ImportObj does not take the object ownership. ImportObj copies the source object and it is users responibility to delete free objects.
obj | - an object to import. |
---|---|
deep_copy | - a boolean indicating whether to perform a deep or shallow copy. In case of shallow copy all indirect references will be set to null. |
PDFNetException |
---|
The function performs a deep copy of all objects specified in the 'obj_list'. If objects in the list are directly or indirectly reffering to the same object/s, only one copy of the shared object/s will be copied. Therefore, unlike repeated calls to ImportObj, this method will import only one copy of shared objects (objects representing an intersection of graphs specified through 'obj_list' of root pointers.
Note: - All object in the import list must belong to the same source document.
- The function does not perform the shallow copy since ImportObj() can be used instead.
obj_list | the obj_list |
---|---|
exclusion_list | a list of objects to not include in the deep copy |
PDFNetException |
---|
The function performs a deep copy of all objects specified in the 'obj_list'. If objects in the list are directly or indirectly reffering to the same object/s, only one copy of the shared object/s will be copied. Therefore, unlike repeated calls to ImportObj, this method will import only one copy of shared objects (objects representing an intersection of graphs specified through 'obj_list' of root pointers.
Note: - All object in the import list must belong to the same source document.
- The function does not perform the shallow copy since ImportObj() can be used instead.
obj_list | the obj_list |
---|
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.
If the security handler was successfully initialized it can be later obtained using GetSecurityHandler() method.
Note: 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.
custom_data | used to 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.
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 |
---|
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 |
---|
Checks if SDFDoc is encrypted.
PDFNetException |
---|
Checks if is full save required.
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
INCREMENTAL
in the Save() method.
PDFNetException |
---|
Checks if SDFDoc is modified.
PDFNetException |
---|
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 |
---|
Removes all security from SDFDoc.
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: - Save will modify the SDFDoc 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
.
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. |
header | - File header. A new file header is set only during full save. |
PDFNetException |
---|
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | the output stream to save SDFDoc to |
---|---|
saveMode | save mode (See SDFDoc.SaveMode ). |
progress | A pointer to the progress interface. NULL if progress tracking is not required. |
header | File header. A new file header is set only during full save. |
size | size of the document in bytes |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
This method is deprecated.
use save(OutputStream, SaveMode, ProgressMonitor, String, int)
instead.
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | the output stream to save SDFDoc to |
---|---|
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. |
header | File header. A new file header is set only during full save. |
size | size of the document in bytes |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
This method is deprecated.
use save(SaveMode, ProgressMonitor, String)
instead.
Saves the document to a memory buffer.
- Save will modify the SDFDoc 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. |
header | - File header. A new file header is set only during full save. |
PDFNetException |
---|
This method is deprecated.
use save(String, SaveMode, ProgressMonitor, String)
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: - Save will modify the SDFDoc 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. |
header | - File header. A new file header is set only during full save. |
PDFNetException |
---|
Saves the document to a memory buffer.
- Save will modify the SDFDoc 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. |
header | - File header. A new file header is set only during full save. |
PDFNetException |
---|
This method is deprecated.
use save(OutputStream, SaveMode, ProgressMonitor, String)
instead.
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | the output stream to save SDFDoc to |
---|---|
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. |
header | File header. A new file header is set only during full save. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
Save SDFDoc to output stream
- Save will modify the SDFDoc object's internal representation. As such, the user should acquire a write lock before calling save.
stream | the output stream to save SDFDoc to |
---|---|
saveMode | save mode (See SDFDoc.SaveMode ). |
progress | A pointer to the progress interface. NULL if progress tracking is not required. |
header | File header. A new file header is set only during full save. |
PDFNetException | |
IOException | Signals that an I/O exception has occurred. |
PDFNetException |
The function sets a new SecurityHandler as the current security handler.
handler | the new 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 |
---|
Sometimes it is desirable to modify all indirect references to a given indirect object. It would be inefficient to manually search for all indirect references to a given indirect object. A more efficient and less error prone method is to replace the indirect object in the cross reference table with a new object. This way the object that is referred to is modified (or replaced) and indirect references do not have to be changed.
obj_num1 | the obj_num1 |
---|---|
obj_num2 | the obj_num2 |
PDFNetException |
---|
Try locking the document, waiting no longer than specified number of milliseconds.
milliseconds | the milliseconds |
---|
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 obtaining a read lock on the document in non-blocking manner.
PDFNetException |
---|