Loading...
Searching...
No Matches
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

## ◆ Result

enum pdftron::PDF::DocumentConversion::Result

Enumerator
eSuccess |
eIncomplete |
eFailure |

Definition at line 29 of file DocumentConversion.h.

## Constructor & Destructor Documentation

## ◆ DocumentConversion() [1/3]

pdftron::PDF::DocumentConversion::DocumentConversion | ( |  | ) |

## ◆ DocumentConversion() [2/3]

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

## ◆ DocumentConversion() [3/3]

pdftron::PDF::DocumentConversion::DocumentConversion | ( | TRN_DocumentConversion | impl | ) |

## ◆ ~DocumentConversion()

pdftron::PDF::DocumentConversion::~DocumentConversion | ( |  | ) |

## Member Function Documentation

## ◆ CancelConversion()

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

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

## ◆ Convert()

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

Perform the conversion. Will throw an exception on failure.

## ◆ ConvertNextPage()

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.

## ◆ CreateInternal()

DocumentConversion * pdftron::PDF::DocumentConversion::CreateInternal | ( | ptrdiff_t | impl | ) |
| static

## ◆ Destroy()

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

## ◆ GetConversionStatus()

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

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

Returns
  .

## ◆ GetCurrentExcelSheetName()

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.

## ◆ GetDoc()

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.

## ◆ GetErrorString()

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.

## ◆ GetHandleInternal()

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

## ◆ GetNextExcelSheetCellCount()

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.

## ◆ GetNumConvertedPages()

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.

## ◆ GetNumWarnings()

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.

## ◆ GetProgress()

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.

## ◆ GetProgressLabel()

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.

## ◆ GetWarningString()

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.

## ◆ HasProgressTracking()

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

Determine whether this DocumentConversion has progress reporting capability.

Returns
  True if GetProgress is expected to return usable values.

## ◆ IsCancelled()

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

Has the conversion been cancelled?.

Returns
  Returns true if CancelConversion has been called previously.

## ◆ operator=()

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

## ◆ SkipNextExcelSheet()

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

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

## ◆ TryConvert()

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

## ◆ m_impl

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