SDFDoc Class |
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.
Namespace: pdftron.SDF
public sealed class SDFDoc : IClosable
The SDFDoc type exposes the following members.
Name | Description | |
---|---|---|
SDFDoc |
Creates a new SDF document.
| |
SDFDoc(Byte) |
Creates a new SDF document from an array of bytes.
| |
SDFDoc(String) |
Creates a new SDF document from the specified full path of the file.
| |
SDFDoc(IBuffer) |
Creates a new SDF document from a buffer.
| |
SDFDoc(IFilter) |
Creates a new SDF document from an existing IFilter instance.
| |
SDFDoc(PDFDoc) |
Creates a new SDF document from an existing PDFDoc instance.
|
Name | Description | |
---|---|---|
ClearMarks |
Removes 'marked' flag from all objects in cross reference table.
| |
Close | ||
CreateIndirectArray |
Creates an indirect Array Obj.
| |
CreateIndirectBool |
Creates an indirect Bool Obj.
| |
CreateIndirectDict |
Creates an indirect Dict Obj.
| |
CreateIndirectName |
Creates an indirect Name Obj.
| |
CreateIndirectNull |
Creates an indirect Null Obj.
| |
CreateIndirectNumber |
Creates an indirect Number Obj.
| |
CreateIndirectStream(Byte) |
Creates an indirect stream.
| |
CreateIndirectStream(FilterReader) |
Creates an indirect stream.
| |
CreateIndirectStream(Byte, IFilter) |
Creates an indirect stream.
| |
CreateIndirectStream(FilterReader, IFilter) |
Creates an indirect stream.
| |
CreateIndirectString(Byte) |
Creates an indirect String Obj.
| |
CreateIndirectString(String) |
Creates an indirect String Obj.
| |
Destroy |
Closes/Destroys this document.
| |
EnableDiskCaching |
Sets this document to use a temporary file in order to cache new content streams.
| |
Equals | (Inherited from Object.) | |
GetFileName |
Gets the filename of this SDFDoc.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetHeader |
Gets the PDF file header.
| |
GetHintStream |
Gets document's initial linearization hint stream if it is available.
| |
GetLinearizationDict |
Gets document's initial linearization dictionary if it is available.
| |
GetObj |
Gets the Obj specified by the object number.
| |
GetTrailer |
Gets the trailer of this document.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasRepairedXRef | 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.
| |
ImportObj |
Import an Obj to this document.
| |
InitSecurityHandler |
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.
| |
InitStdSecurityHandler(Byte) |
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.
| |
InitStdSecurityHandler(String) |
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.
| |
IsEncrypted |
Checks if this document is encrypted.
| |
IsFullSaveRequired |
Checks if is full save required.
| |
IsLinearized |
Call this function to determine whether the document is represented in linearized(fast web view) format.
| |
IsModified |
Checks if this document is modified.
| |
Lock |
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().
| |
LockRead |
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().
| |
SaveAsync(String, SDFDocSaveOptions, String) |
Saves the document to a specified file.
| |
SaveAsync(IFilter, SDFDocSaveOptions, String) |
Saves all changes to the document and writes them to an output IFilter sink.
| |
SaveToBufferAsync |
Saves all changes to the document and writes them to a buffer
| |
Swap | Gets the security handler.
| |
TimedLock |
Try locking the document, waiting no longer than specified number of milliseconds.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryLock |
Try locking the document.
| |
Unlock |
Removes the lock from the document.
| |
UnlockRead |
Removes the read lock from the document.
| |
XRefSize |
Gets the size of the cross reference table.
|
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.
SDFDoc mydoc = new SDFDoc();
Obj trailer = mydoc.GetTrailer();
SDFDoc mydoc = new SDFDoc("in.pdf"); Obj trailer = mydoc.GetTrailer();
MemoryFilter memory = ....
SDFDoc mydoc = new SDFDoc(memory);
Obj trailer = mydoc.GetTrailer();
PDFDoc doc = new PDFDoc("in.pdf"); SDFDoc mydoc = doc.GetSDFDoc(); Obj trailer = mydoc.GetTrailer();