Creates a new empty document.
documentType
Document type. Cannot be null.
options
Options to use when creating the document. Cannot be null.
The newly created document.
Use this method to create a new empty document. documentType controls the type of the document created and the following values are currently supported:
Value | Description |
---|---|
"Raster" |
Creates a new Raster document. Requires the Leadtools.Documents.Raster.dll assembly. |
"Pdf" |
Creates a new PDF document. Requires the Leadtools.Documents.Pdf.dll assembly. |
"Virtual" | Creates a new empty virtual document ready to be filled with pages from other documents. This is the equivalant of calling DocumentFactory.Create(createdocumentoptions) |
Any other value | Will throw an exception. |
This method will add items with the key "Created", "Accessed" and "Modified" to Metadata with values equal to the current date and time. The newly created Document object will have an empty list of Pages. It can then be populated by the user.
The member of options are used as follows:
Member | Description |
---|---|
Cache and UseCache | Used to determine if the newly created document will be saved into the cache later. |
CachePolicy | If caching is used: Copied to the newly created document and is used to determine when the document and its item are purged from the cache. |
DocumentId |
The ID to be used with the loaded document. When this value null (the default), then the document factory will create a new unique ID using a GUID generator. If the value is not null, then it is assumed to be a user-defined ID and used as is. In either case, the value is set in the Document.DocumentId property of the newly created document. User-defined IDs can be used when the system already have unique ID's associated with the documents to be viewer. The document factory will not check nor guarantee the uniqness of these IDs. |
MimeType | Copied as is into the newly created document MimeType member. This value can be null but it is recommend you set it to the MIME type of the document since it will be used when saving the document. Use one of the MIME types constants defined in the Constants class. In the case of virtual documents, this value can be left as null. |
For an example, refer to Create.