All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::DocumentConversion Class Reference

#include <DocumentConversion.h>

Public Types

enum  Result { eSuccess = 0, eIncomplete = 1, eFailure = 2 }

Public Member Functions

 DocumentConversion ()
 DocumentConversion (const DocumentConversion &other)
 DocumentConversion (TRN_DocumentConversion impl)
DocumentConversionoperator= (const DocumentConversion &other)
 ~DocumentConversion ()
void Destroy ()
Result TryConvert ()
void Convert ()
void ConvertNextPage ()
PDF::PDFDoc GetDoc ()
Result GetConversionStatus () const
void CancelConversion ()
bool IsCancelled () const
bool HasProgressTracking () const
double GetProgress () const
UString GetProgressLabel () const
UInt32 GetNumConvertedPages () const
UString GetErrorString () const
UInt32 GetNumWarnings () const
UString GetWarningString (UInt32 index) const
ptrdiff_t GetHandleInternal ()

Static Public Member Functions

static DocumentConversionCreateInternal (ptrdiff_t impl)

Public Attributes

TRN_DocumentConversion m_impl

Detailed Description

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

DocumentConversion instances are created through methods belonging to the Convert class. See Convert.WordToPDFConversion for an example.

Definition at line 24 of file DocumentConversion.h.

Member Enumeration Documentation


Definition at line 28 of file DocumentConversion.h.

Constructor & Destructor Documentation

pdftron::PDF::DocumentConversion::DocumentConversion ( )
pdftron::PDF::DocumentConversion::DocumentConversion ( const DocumentConversion other)
pdftron::PDF::DocumentConversion::DocumentConversion ( TRN_DocumentConversion  impl)
pdftron::PDF::DocumentConversion::~DocumentConversion ( )

Member Function Documentation

void pdftron::PDF::DocumentConversion::CancelConversion ( )

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

void pdftron::PDF::DocumentConversion::Convert ( )

Perform the conversion. Will throw an exception on failure.

void pdftron::PDF::DocumentConversion::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.

static DocumentConversion* pdftron::PDF::DocumentConversion::CreateInternal ( ptrdiff_t  impl)
void pdftron::PDF::DocumentConversion::Destroy ( )
Result pdftron::PDF::DocumentConversion::GetConversionStatus ( ) const

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

PDF::PDFDoc pdftron::PDF::DocumentConversion::GetDoc ( )

Get a reference to the output pdf.

UString pdftron::PDF::DocumentConversion::GetErrorString ( ) const

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

The error description. Will be blank unless GetConversionStatus returns Failure.
ptrdiff_t pdftron::PDF::DocumentConversion::GetHandleInternal ( )
UInt32 pdftron::PDF::DocumentConversion::GetNumConvertedPages ( ) const

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".

The number of pages that have been converted.
UInt32 pdftron::PDF::DocumentConversion::GetNumWarnings ( ) const

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.

The number of stored warning strings.
double pdftron::PDF::DocumentConversion::GetProgress ( ) const

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).

The conversion progress. Will never return a smaller number than a previous call.
UString pdftron::PDF::DocumentConversion::GetProgressLabel ( ) const

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.

The stage label.
UString pdftron::PDF::DocumentConversion::GetWarningString ( UInt32  index) const

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.

index– the index of the string to be retrieved. Must be less than GetNumWarnings().
The value of the particular warning string.
bool pdftron::PDF::DocumentConversion::HasProgressTracking ( ) const

Determine whether this DocumentConversion has progress reporting capability.

True if GetProgress is expected to return usable values.
bool pdftron::PDF::DocumentConversion::IsCancelled ( ) const

Has the conversion been cancelled?.

Returns true if CancelConversion has been called previously.
DocumentConversion& pdftron::PDF::DocumentConversion::operator= ( const DocumentConversion other)
Result pdftron::PDF::DocumentConversion::TryConvert ( )

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

Indicates that the conversion succeeded, failed, or was cancelled.

Member Data Documentation

TRN_DocumentConversion pdftron::PDF::DocumentConversion::m_impl

Definition at line 144 of file DocumentConversion.h.

The documentation for this class was generated from the following file: