- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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)
DocumentConversion & | operator= (const DocumentConversion &other)
| ~DocumentConversion ()
void | Destroy ()
Result | TryConvert ()
void | Convert ()
void | ConvertNextPage ()
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
UString | GetCurrentExcelSheetName () const
UInt32 | GetNextExcelSheetCellCount () const
void | SkipNextExcelSheet ()
ptrdiff_t | GetHandleInternal ()

## Static Public Member Functions
static DocumentConversion * | CreateInternal (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 26 of file DocumentConversion.h.

## Member Enumeration Documentation

enum pdftron::PDF::DocumentConversion::Result

Enumerator
eSuccess |
eIncomplete |
eFailure |

Definition at line 29 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 | ) |
| static

void pdftron::PDF::DocumentConversion::Destroy | ( |  | ) |

Result pdftron::PDF::DocumentConversion::GetConversionStatus | ( |  | ) | const

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

Returns
  .

UString pdftron::PDF::DocumentConversion::GetCurrentExcelSheetName | ( |  | ) | const

Retrieve the name of the Excel sheet placed on the last converted page if any.

Returns
  The name of the Excel sheet.

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

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

Returns
  The conversion's PDFDoc.

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

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

Returns
  The error description. Will be blank unless GetConversionStatus returns Failure.

ptrdiff_t pdftron::PDF::DocumentConversion::GetHandleInternal | ( |  | ) |

UInt32 pdftron::PDF::DocumentConversion::GetNextExcelSheetCellCount | ( |  | ) | const

Retrieve the number of cells in the Excel sheet that will be converted next.

Returns
  The number of cells.

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

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

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

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

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

Parameters

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

Returns
  The value of the particular warning string.

bool pdftron::PDF::DocumentConversion::HasProgressTracking | ( |  | ) | const

Determine whether this DocumentConversion has progress reporting capability.

Returns
  True if GetProgress is expected to return usable values.

bool pdftron::PDF::DocumentConversion::IsCancelled | ( |  | ) | const

Has the conversion been cancelled?.

Returns
  Returns true if CancelConversion has been called previously.

DocumentConversion& pdftron::PDF::DocumentConversion::operator= | ( | const DocumentConversion & | other | ) |

void pdftron::PDF::DocumentConversion::SkipNextExcelSheet | ( |  | ) |

Skip the next Excel sheet. The sheet will not be converted.

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.

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

## Member Data Documentation

TRN_DocumentConversion pdftron::PDF::DocumentConversion::m_impl

Definition at line 164 of file DocumentConversion.h.

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

- PDF/DocumentConversion.h