PrizmDoc Server .NET SDK

Show / Hide Table of Contents

Class ConversionSourceDocument

Defines a document or pages of a document which should be used as input for a conversion.

Typically, you create a source document from a local file path, like this:

var sourceDocument = new ConversionSourceDocument("my-local-file.docx");

You can optionally specify a specific set of pages to use:

var sourceDocument = new ConversionSourceDocument("my-local-file.docx", pages: "2, 5-9, 14-");

And, if the document is password-protected, you can optionally specify the password required to open it:

var sourceDocument = new ConversionSourceDocument("secret.docx", password: "opensesame");

Finally, you can create a source document from an already-existing remote work file, like so:

var result = await prizmDocServer.ConvertToPdfAsync("my-local-file.docx");
var sourceDocument = new ConversionSourceDocument(result.RemoteWorkFile);

In this way, you can use the results of one operation as input to a subsequent operation without needing to download the intermediate results.

Inheritance
Object
ConversionSourceDocument
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Accusoft.PrizmDocServer.Conversion
Assembly: PrizmDocServerSDK.dll
Syntax
public class ConversionSourceDocument

Constructors

ConversionSourceDocument(RemoteWorkFile, String, String)

Initializes a new instance of the ConversionSourceDocument class for an existing remote work file.

Declaration
public ConversionSourceDocument(RemoteWorkFile remoteWorkFile, string pages = null, string password = null)
Parameters
Type Name Description
RemoteWorkFile remoteWorkFile

Remote work file to use as a source document.

String pages

When provided, causes the conversion to only use a specified set of pages from the source document. Page numbers are 1-indexed. You can think of this argument like a "pages" input text field in a typical print dialog box. For example, the value can be a single page like "2", a comma-delimited list of specific pages like "1, 4, 5", an open-ended page range like "2-" (page 2 through the end of the document), or a combination of these, like "2, 4-9, 12-".

String password

Password to open the document. Only required if the document requires a password to open.

ConversionSourceDocument(String, String, String)

Initializes a new instance of the ConversionSourceDocument class for a local file.

Declaration
public ConversionSourceDocument(string localFilePath, string pages = null, string password = null)
Parameters
Type Name Description
String localFilePath

Local file to use as a source document.

String pages

When provided, causes the conversion to only use a specified set of pages from the source document. Page numbers are 1-indexed. You can think of this argument like a "pages" input text field in a typical print dialog box. For example, the value can be a single page like "2", a comma-delimited list of specific pages like "1, 4, 5", an open-ended page range like "2-" (page 2 through the end of the document), or a combination of these, like "2, 4-9, 12-".

String password

Password to open the document. Only required if the document requires a password to open.

Properties

LocalFilePath

Gets the local file path associated with this source document or null if this source document is not associated with a local file path.

Declaration
public string LocalFilePath { get; }
Property Value
Type Description
String

Pages

Gets the specific pages which should be used or null if the entire document should be used.

Declaration
public string Pages { get; }
Property Value
Type Description
String

RemoteWorkFile

Gets the associated RemoteWorkFile for this source document or null if the remote work file has not yet been created.

Declaration
public RemoteWorkFile RemoteWorkFile { get; }
Property Value
Type Description
RemoteWorkFile
Back to top © 2019-2020 Accusoft Corporation. All Rights Reserved.