iDRS™ SDK 16
Loading...
Searching...
No Matches
CDocumentWriter_interface.h File Reference

Interface for CDocumentWriter wrapper. More...

Go to the source code of this file.

Functions

CDocumentWriter CDocumentWriter_Create (const CIDRS argIDRS, idrs_exception *pargException)
 Create creates a CDocumentWriter object.
 
CDocumentWriter CDocumentWriter_Create2 (const CIDRS argIDRS, IBaseImagePlugin argImagePlugin, idrs_exception *pargException)
 Create creates a CDocumentWriter object.
 
IDRS_ERROR CDocumentWriter_Save (const CDocumentWriter argCDocumentWriter, const idrs_string strOutputFilePath, const CDocument argDocument, idrs_exception *pargException)
 Creates the output file using the supplied document and writes it to the given file path.
 
IDRS_ERROR CDocumentWriter_Save2 (const CDocumentWriter argCDocumentWriter, IByteStream argOutputStream, const CDocument argDocument, idrs_exception *pargException)
 Creates the output file using the supplied document and writes it to the given stream.
 
IDRS_ERROR CDocumentWriter_Save3 (const CDocumentWriter argCDocumentWriter, const idrs_string strOutputFilePath, const CPageArray argPageArray, idrs_exception *pargException)
 Creates the output file using the supplied pages array and writes it to the given file path.
 
IDRS_ERROR CDocumentWriter_Save4 (const CDocumentWriter argCDocumentWriter, IByteStream argOutputStream, const CPageArray argPageArray, idrs_exception *pargException)
 Creates the output file using the supplied pages array and writes it to the given stream.
 
IDRS_ERROR CDocumentWriter_Save5 (const CDocumentWriter argCDocumentWriter, const idrs_string strOutputFilePath, const CPage xargPageBuffer[], IDRS_UINT const uiPageCount, idrs_exception *pargException)
 Creates the output file using the supplied pages and writes it to the given file path.
 
IDRS_ERROR CDocumentWriter_Save6 (const CDocumentWriter argCDocumentWriter, IByteStream argOutputStream, const CPage xargPageBuffer[], IDRS_UINT const uiPageCount, idrs_exception *pargException)
 Creates the output file using the supplied pages and writes it to the given stream.
 
IDRS_ERROR CDocumentWriter_Save7 (const CDocumentWriter argCDocumentWriter, IStreamFactory argStreamFactory, const CDocument argDocument, idrs_exception *pargException)
 Creates one or more output documents using the supplied document object. The method is using argStreamFactory to create one or more streams for the output document(s).
 
IDRS_ERROR CDocumentWriter_Save8 (const CDocumentWriter argCDocumentWriter, IStreamFactory argStreamFactory, const CPageArray argPageArray, idrs_exception *pargException)
 Creates one or more output documents using the supplied pages array. The method is using argStreamFactory to create one or more streams for the output document(s).
 
IDRS_ERROR CDocumentWriter_Save9 (const CDocumentWriter argCDocumentWriter, IStreamFactory argStreamFactory, const CPage xargPageBuffer[], IDRS_UINT const uiPageCount, idrs_exception *pargException)
 Creates one or more output documents using the supplied pages. The method is using argStreamFactory to create one or more streams for the output document(s).
 
void CDocumentWriter_SetOutputParams (CDocumentWriter argCDocumentWriter, const COutputParams argOutputParams, idrs_exception *pargException)
 Sets the parameters used to generate the output document.
 
COutputParams CDocumentWriter_GetOutputParams (const CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 Gets the output parameters property value.
 
IFontDataProviderCallback CDocumentWriter_GetFontDataProvider (const CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 Gets the callback object used for formatting.
 
void CDocumentWriter_SetFontDataProvider (CDocumentWriter argCDocumentWriter, IFontDataProviderCallback argpFontProviderCallback, idrs_exception *pargException)
 Sets the callback class used by integrators to retrieve font data when creating documents.
 
void CDocumentWriter_SetDocumentMaxMemoryConsumption (CDocumentWriter argCDocumentWriter, IDRS_UINT64 const uiMaxMemoryConsumption, idrs_exception *pargException)
 Sets the threshold for the maximum amount of memory that will be allocated to store the output document in memory. When nearing this threshold, temporary files will be used to avoid crossing it.
 
IDRS_UINT64 CDocumentWriter_GetDocumentMaxMemoryConsumption (const CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 Gets the value for the max memory consumption threshold.
 
void CDocumentWriter_SetOutputProgressCallback (CDocumentWriter argCDocumentWriter, IProgressDocumentWriting argpProgress, idrs_exception *pargException)
 Sets the object for monitoring progress.
 
IProgressDocumentWriting CDocumentWriter_GetOutputProgressCallback (const CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 GetOutputProgressCallback gets the object used for monitoring progress.
 
enum ThreadingMode CDocumentWriter_GetThreadingMode (const CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 Returns the threading mode that should be used for the document output process.
 
void CDocumentWriter_SetThreadingMode (CDocumentWriter argCDocumentWriter, const enum ThreadingMode *const evThreadingMode, idrs_exception *pargException)
 Sets the threading mode used for the document output process.
 
OutputThreadingConfig CDocumentWriter_GetAdvancedThreadingConfig (const CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 Gets the threading config used for the document output process.
 
void CDocumentWriter_SetAdvancedThreadingConfig (CDocumentWriter argCDocumentWriter, const OutputThreadingConfig *stThreadingConfig, idrs_exception *pargException)
 Sets the threading config used for the document output process.
 
void CDocumentWriter_Destroy (CDocumentWriter argCDocumentWriter, idrs_exception *pargException)
 Destroys a CDocumentWriter handle.
 

Detailed Description

Interface for CDocumentWriter wrapper.

Function Documentation

◆ CDocumentWriter_Create()

CDocumentWriter CDocumentWriter_Create ( const CIDRS  argIDRS,
idrs_exception *  pargException 
)

Create creates a CDocumentWriter object.

Parameters
argIDRSThe IDRS handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_Create2()

CDocumentWriter CDocumentWriter_Create2 ( const CIDRS  argIDRS,
IBaseImagePlugin  argImagePlugin,
idrs_exception *  pargException 
)

Create creates a CDocumentWriter object.

This CDocumentWriter object will use the specified image compressor.

Parameters
argIDRSThe IDRS handle
argImagePluginThe external image plugin to use.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_Destroy()

void CDocumentWriter_Destroy ( CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

Destroys a CDocumentWriter handle.

Parameters
argCDocumentWriterCDocumentWriter handle to destroy
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_GetAdvancedThreadingConfig()

OutputThreadingConfig CDocumentWriter_GetAdvancedThreadingConfig ( const CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

Gets the threading config used for the document output process.

By default, the threading config is set to no multithreading

Returns
Threading config used for the document output process
Parameters
argCDocumentWriterCDocumentWriter handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_GetDocumentMaxMemoryConsumption()

IDRS_UINT64 CDocumentWriter_GetDocumentMaxMemoryConsumption ( const CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

Gets the value for the max memory consumption threshold.

Returns
The maximum memory consumption threshold (in bytes)
Parameters
argCDocumentWriterCDocumentWriter handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_GetFontDataProvider()

IFontDataProviderCallback CDocumentWriter_GetFontDataProvider ( const CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

Gets the callback object used for formatting.

Returns
The callback pointer
Parameters
argCDocumentWriterCDocumentWriter handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_GetOutputParams()

COutputParams CDocumentWriter_GetOutputParams ( const CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

Gets the output parameters property value.

Returns
The output parameters.
Parameters
argCDocumentWriterCDocumentWriter handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_GetOutputProgressCallback()

IProgressDocumentWriting CDocumentWriter_GetOutputProgressCallback ( const CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

GetOutputProgressCallback gets the object used for monitoring progress.

Returns
The callback pointer
Parameters
argCDocumentWriterCDocumentWriter handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_GetThreadingMode()

enum ThreadingMode CDocumentWriter_GetThreadingMode ( const CDocumentWriter  argCDocumentWriter,
idrs_exception *  pargException 
)

Returns the threading mode that should be used for the document output process.

Please see

See also
ThreadingMode for details about the available threading modes.
Returns
The threading mode to be used
Remarks
Default value is set to ThreadingMode::None
Parameters
argCDocumentWriterCDocumentWriter handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_Save()

IDRS_ERROR CDocumentWriter_Save ( const CDocumentWriter  argCDocumentWriter,
const idrs_string  strOutputFilePath,
const CDocument  argDocument,
idrs_exception *  pargException 
)

Creates the output file using the supplied document and writes it to the given file path.

Parameters
argCDocumentWriterCDocumentWriter handle
strOutputFilePathThe path to the output file.
argDocumentThe document containing the pages to format.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation

◆ CDocumentWriter_Save2()

IDRS_ERROR CDocumentWriter_Save2 ( const CDocumentWriter  argCDocumentWriter,
IByteStream  argOutputStream,
const CDocument  argDocument,
idrs_exception *  pargException 
)

Creates the output file using the supplied document and writes it to the given stream.

Parameters
argCDocumentWriterCDocumentWriter handle
argOutputStreamThe stream where the document content will be written.
argDocumentThe document containing the pages to format.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation

◆ CDocumentWriter_Save3()

IDRS_ERROR CDocumentWriter_Save3 ( const CDocumentWriter  argCDocumentWriter,
const idrs_string  strOutputFilePath,
const CPageArray  argPageArray,
idrs_exception *  pargException 
)

Creates the output file using the supplied pages array and writes it to the given file path.

Parameters
argCDocumentWriterCDocumentWriter handle
strOutputFilePathThe path to the output file.
argPageArrayThe array containing the pages to format.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
Note
Note that unlike the overload that takes a CDocument as a parameter, it is not possible to configure metadata that are specific to the document level, such as bookmarks, attachments, and metadata information.

◆ CDocumentWriter_Save4()

IDRS_ERROR CDocumentWriter_Save4 ( const CDocumentWriter  argCDocumentWriter,
IByteStream  argOutputStream,
const CPageArray  argPageArray,
idrs_exception *  pargException 
)

Creates the output file using the supplied pages array and writes it to the given stream.

Parameters
argCDocumentWriterCDocumentWriter handle
argOutputStreamThe stream where the document content will be written.
argPageArrayThe array containing the pages to format.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
Note
Note that unlike the overload that takes a CDocument as a parameter, it is not possible to configure metadata that are specific to the document level, such as bookmarks, attachments, and metadata information.

◆ CDocumentWriter_Save5()

IDRS_ERROR CDocumentWriter_Save5 ( const CDocumentWriter  argCDocumentWriter,
const idrs_string  strOutputFilePath,
const CPage  xargPageBuffer[],
IDRS_UINT const  uiPageCount,
idrs_exception *  pargException 
)

Creates the output file using the supplied pages and writes it to the given file path.

Parameters
argCDocumentWriterCDocumentWriter handle
strOutputFilePathThe path to the output file.
xargPageBufferThe buffer containing the pages to format.
uiPageCountThe number of pages in xPageBuffer.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
Note
Note that unlike the overload that takes a CDocument as a parameter, it is not possible to configure metadata that are specific to the document level, such as bookmarks, attachments, and metadata information.

◆ CDocumentWriter_Save6()

IDRS_ERROR CDocumentWriter_Save6 ( const CDocumentWriter  argCDocumentWriter,
IByteStream  argOutputStream,
const CPage  xargPageBuffer[],
IDRS_UINT const  uiPageCount,
idrs_exception *  pargException 
)

Creates the output file using the supplied pages and writes it to the given stream.

Parameters
argCDocumentWriterCDocumentWriter handle
argOutputStreamThe stream where the document content will be written.
xargPageBufferThe buffer containing the pages to format.
uiPageCountThe number of pages in xPageBuffer.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
Note
Note that unlike the overload that takes a CDocument as a parameter, it is not possible to configure metadata that are specific to the document level, such as bookmarks, attachments, and metadata information.

◆ CDocumentWriter_Save7()

IDRS_ERROR CDocumentWriter_Save7 ( const CDocumentWriter  argCDocumentWriter,
IStreamFactory  argStreamFactory,
const CDocument  argDocument,
idrs_exception *  pargException 
)

Creates one or more output documents using the supplied document object. The method is using argStreamFactory to create one or more streams for the output document(s).

The document will be split into one or more streams, according to the options set in argDocumentSplitParameters argument.

Parameters
argCDocumentWriterCDocumentWriter handle
argStreamFactoryOutput stream creator factory
argDocumentCDocument instance containing the information about the image and the recognition results
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
See also
CDocument
IStreamFactory
Note
The document split feature is available for the moment with the following restrictions:
  • PDF output only
  • No encryption, certification, header/footer
  • Linearization disabled If the document split type is different than None and any of these constraint is not fulfilled, an exception IDRS_ERROR_NOT_SUPPORTED will be thrown.

◆ CDocumentWriter_Save8()

IDRS_ERROR CDocumentWriter_Save8 ( const CDocumentWriter  argCDocumentWriter,
IStreamFactory  argStreamFactory,
const CPageArray  argPageArray,
idrs_exception *  pargException 
)

Creates one or more output documents using the supplied pages array. The method is using argStreamFactory to create one or more streams for the output document(s).

The document will be split into one or more streams, according to the options set in argDocumentSplitParameters argument.

Parameters
argCDocumentWriterCDocumentWriter handle
argStreamFactoryOutput stream creator factory
argPageArrayThe array containing the pages to format.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
See also
IStreamFactory
Note
The document split feature is available for the moment with the following restrictions:
  • PDF output only
  • No encryption, certification, header/footer
  • Linearization disabled If the document split type is different than None and any of these constraint is not fulfilled, an exception IDRS_ERROR_NOT_SUPPORTED will be thrown. Unlike the overload that takes a CDocument as a parameter, it is not possible to configure metadata that are specific to the document level, such as bookmarks, attachments, and metadata information.

◆ CDocumentWriter_Save9()

IDRS_ERROR CDocumentWriter_Save9 ( const CDocumentWriter  argCDocumentWriter,
IStreamFactory  argStreamFactory,
const CPage  xargPageBuffer[],
IDRS_UINT const  uiPageCount,
idrs_exception *  pargException 
)

Creates one or more output documents using the supplied pages. The method is using argStreamFactory to create one or more streams for the output document(s).

The document will be split into one or more streams, according to the options set in argDocumentSplitParameters argument.

Parameters
argCDocumentWriterCDocumentWriter handle
argStreamFactoryOutput stream creator factory
xargPageBufferThe buffer containing the pages to format.
uiPageCountThe number of pages in xPageBuffer.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
IDRS_SUCCESS if document created as expected, or specific warning identifier if document creation succeeded but required altered configuration.
Exceptions
CIDRSExceptionin case of non-recoverable issue preventing document creation
See also
IStreamFactory
CDocumentSplitParams
Note
The document split feature is available for the moment with the following restrictions:
  • PDF output only
  • No encryption, certification, header/footer
  • Linearization disabled If the document split type is different than None and any of these constraint is not fulfilled, an exception IDRS_ERROR_NOT_SUPPORTED will be thrown. Unlike the overload that takes a CDocument as a parameter, it is not possible to configure metadata that are specific to the document level, such as bookmarks, attachments, and metadata information.

◆ CDocumentWriter_SetAdvancedThreadingConfig()

void CDocumentWriter_SetAdvancedThreadingConfig ( CDocumentWriter  argCDocumentWriter,
const OutputThreadingConfig stThreadingConfig,
idrs_exception *  pargException 
)

Sets the threading config used for the document output process.

Threading config can be altered directly by integrators, or set to recommended values via property ThreadingMode.

Parameters
argCDocumentWriterCDocumentWriter handle
stThreadingConfigThreading config to set
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_SetDocumentMaxMemoryConsumption()

void CDocumentWriter_SetDocumentMaxMemoryConsumption ( CDocumentWriter  argCDocumentWriter,
IDRS_UINT64 const  uiMaxMemoryConsumption,
idrs_exception *  pargException 
)

Sets the threshold for the maximum amount of memory that will be allocated to store the output document in memory. When nearing this threshold, temporary files will be used to avoid crossing it.

Remarks
For the moment the following limitations exist:
  • Threshold is monitored only for PDF output format. Other formats will not take it into account (however they are less likely to grow very large in memory)
  • For PDF, only compressed image stream size (usually a very large part of the PDF document itself) is taken into account.
Parameters
argCDocumentWriterCDocumentWriter handle
uiMaxMemoryConsumptionThe maximum memory consumption threshold (in bytes)
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_SetFontDataProvider()

void CDocumentWriter_SetFontDataProvider ( CDocumentWriter  argCDocumentWriter,
IFontDataProviderCallback  argpFontProviderCallback,
idrs_exception *  pargException 
)

Sets the callback class used by integrators to retrieve font data when creating documents.

Parameters
argCDocumentWriterCDocumentWriter handle
argpFontProviderCallbackReference to a class containing an implementation for IFontDataProviderCallback
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_SetOutputParams()

void CDocumentWriter_SetOutputParams ( CDocumentWriter  argCDocumentWriter,
const COutputParams  argOutputParams,
idrs_exception *  pargException 
)

Sets the parameters used to generate the output document.

The output parameters are used during the output document saving process, thus they must be set prior to invoking the Save() method.

Parameters
argCDocumentWriterCDocumentWriter handle
argOutputParamsThe output parameters.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_SetOutputProgressCallback()

void CDocumentWriter_SetOutputProgressCallback ( CDocumentWriter  argCDocumentWriter,
IProgressDocumentWriting  argpProgress,
idrs_exception *  pargException 
)

Sets the object for monitoring progress.

The methods of the object overiding the methods of the IProgressDocumentWriting class will be called during the execution. This let the integrator implement a cancel button or a progress bar.

Parameters
argCDocumentWriterCDocumentWriter handle
argpProgressThe object to use for monitoring the progress.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CDocumentWriter_SetThreadingMode()

void CDocumentWriter_SetThreadingMode ( CDocumentWriter  argCDocumentWriter,
const enum ThreadingMode *const  evThreadingMode,
idrs_exception *  pargException 
)

Sets the threading mode used for the document output process.

Please see

See also
ThreadingMode for details about the available threading modes. Calling SetThreadingMode() will set the threading configuration with the default values associated with the mode chosen. This will invalidate any custom change made via property AdvancedThreadingConfig.
Parameters
argCDocumentWriterCDocumentWriter handle
evThreadingModeThe threading mode to be used
pargExceptionPointer to exception structure that will be filled if an exception occurs