Show / Hide Table of Contents

Class DocumentConversion

Encapsulates the conversion of a single document from one format to another.

Inheritance
System.Object
DocumentConversion
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public sealed class DocumentConversion : IDisposable

Methods

CancelConversion()

Cancel the current conversion, forcing TryConvert or Convert to return.

Declaration
public void CancelConversion()

Convert()

Perform the conversion. Will throw an exception on failure.

Declaration
public void Convert()

ConvertNextPage()

Perform the conversion. Will throw an exception on failure. Does nothing if the conversion is already complete. Use GetConversionStatus() to check if there is remaining content to be converted.

Declaration
public void ConvertNextPage()

Dispose()

Declaration
public override sealed void Dispose()

Dispose(Boolean)

Declaration
[HandleProcessCorruptedStateExceptions]
protected void Dispose(bool A_0)
Parameters
Type Name Description
System.Boolean A_0

Finalize()

Declaration
protected void Finalize()

GetConversionStatus()

Get the state of the conversion process. Pair this with ConvertNextPage().

Declaration
public DocumentConversionResult GetConversionStatus()
Returns
Type Description
DocumentConversionResult

GetDoc()

Gets the PDFDoc from the conversion. Can be accessed at any time during or after conversion.

Declaration
public PDFDoc GetDoc()
Returns
Type Description
PDFDoc

The conversion's PDFDoc

GetErrorString()

If the conversion finsihed with some kind of error, this returns the value of the error description; otherwise returns an empty string.

Declaration
public string GetErrorString()
Returns
Type Description
System.String

The error description. Will be blank unless GetConversionStatus returns Failure

GetNumConvertedPages()

Returns the number of pages which have been added to the destination document. Will never decrease, and will not change after the conversion status becomes "complete".

Declaration
public int GetNumConvertedPages()
Returns
Type Description
System.Int32

The number of pages that have been converted

GetNumWarnings()

Return the number of warning strings generated during the conversion process. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.

Declaration
public int GetNumWarnings()
Returns
Type Description
System.Int32

The number of stored warning strings

GetProgress()

Returns a number from 0.0 to 1.0, representing the best estimate of conversion progress. This number is only an indicator, and should not be used to dictate program logic (in particular, it is possible for this method to return 1.0 while there is still work to be done. Use GetConversionStatus() to find out when the conversion is fully complete).

Declaration
public double GetProgress()
Returns
Type Description
System.Double

The conversion progress. Will never return a smaller number than a previous call

GetProgressLabel()

Returns the label for the current conversion stage. May return a blank string. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.

Declaration
public string GetProgressLabel()
Returns
Type Description
System.String

The stage label

GetWarningString(Int32)

Retrieve warning strings that have been collected during the conversion process. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.

Declaration
public string GetWarningString(int index)
Parameters
Type Name Description
System.Int32 index

the index of the string to be retrieved. Must be less than GetNumWarnings()

Returns
Type Description
System.String

The value of the particular warning string

HasProgressTracking()

Determine whether this DocumentConversion has progress reporting capability.

Declaration
public bool HasProgressTracking()
Returns
Type Description
System.Boolean

True if GetProgress is expected to return usable values

IsCancelled()

Has the conversion been cancelled?.

Declaration
public bool IsCancelled()
Returns
Type Description
System.Boolean

Returns true if CancelConversion has been called previously

TryConvert()

Perform the conversion. If the result of the conversion is failure, then GetErrorString will contain further information about the failure.

Declaration
public DocumentConversionResult TryConvert()
Returns
Type Description
DocumentConversionResult

Indicates that the conversion succeeded, failed, or was cancelled

Implements

System.IDisposable
Back to top Generated by DocFX