7 Export Functions
This chapter covers the following functions:
7.1 EXOpenExport
This function is used to initiate the export process for a file that has been opened by DAOpenDocument. If EXOpenExport succeeds, EXCloseExport must be called regardless of any other API calls.
Prototype
SCCERR EXOpenExport( VTHDOC hDoc, VTDWORD dwOutputId, VTDWORD dwSpecType, VTLPVOID pSpec, VTDWORD dwFlags, VTSYSPARAM dwReserved, VTLPVOID pCallbackFunc, VTSYSPARAM dwCallbackData, VTLPHEXPORT phExport);
phExport is not a file handle.
Parameters
-
hDoc: A handle that identifies the source file, created by DAOpenDocument. Knowledge of this should only affect OEMs under the most unusual of circumstances.
-
dwOutputId: File ID of the desired format of the output file. This value should be set to one of the following values:
-
FI_SEARCHML_LATEST
-
FI_PAGEML
-
FI_SEARCHTEXT
-
FI_SEARCHHTML
-
-
dwSpecType: Describes the contents of pSpec. Together, dwSpecType and pSpec describe the location of the initial output file. Must be one of the following values:
-
IOTYPE_ANSIPATH: Windows only. pSpec points to a NULL-terminated full path name using the ANSI character set and FAT 8.3 (Win16) or NTFS (Win32 and Win64) file name conventions.
-
IOTYPE_UNICODEPATH: Windows only. pSpec points to a NULL-terminated full path name using the Unicode character set and NTFS file name conventions.
Note:
If you are using IOTYPE_UNICODEPATH as a file spec type, if the calling application is providing an export callback function, you should set the option SCCOPT_EX_UNICODECALLBACKSTR to TRUE. For more information, see to the documentation on callbacks such as EX_CALLBACK_ID_CREATENEWFILE and the EXURLFILEIOCALLBACKDATAW structure.
-
IOTYPE_UNIXPATH: UNIX platforms only. pSpec points to a NULL-terminated full path name using the system default character set and UNIX path conventions. Unicode paths can be accessed on UNIX platforms by using a UTF-8 encoded path with IOTYPE_UNIXPATH.
-
IOTYPE_REDIRECT: All platforms. A pointer to a BASEIO structure filled in by your application. This must not be set to NULL or conversion fails.
-
-
pSpec: Initial output file location specification. The form of this data depends on the value of the dwSpecType parameter (see above).Initial output file location specification. This is either a pointer to a buffer or NULL.
-
dwFlags: Must be set by developer to 0.
-
dwReserved: Reserved. Must be set by developer to 0.
-
phExport: Pointer to a handle that receives a value uniquely identifying the document to the product routines. If the function fails, this value is set to VTHDOC_INVALID.
Return Values
-
SCCERR_OK: If the open was successful. Otherwise, one of the other SCCERR_ values in sccerr.h is returned.
7.2 EXCloseExport
This function is called to terminate the export process for a file.
Prototype
SCCERR EXCloseExport( VTHEXPORT hExport);
Parameters
-
hExport: Export handle for the document. Must be a handle returned by the EXOpenExport function.
Return Values
-
SCCERR_OK: Returned if the close was successful. Otherwise, one of the other SCCERR_ values in sccerr.h is returned.
7.3 EXRunExport
This function is called to run the export process.
Prototype
SCCERR EXRunExport( VTHEXPORT hExport);
Parameters
-
hExport: Export handle for the document. Must be a handle returned by the EXOpenExport function.
Return Values
-
SCCERR_OK: Returned if the export was successful. Otherwise, one of the other SCCERR_ values in sccerr.h is returned.
7.4 EXExportStatus
This function is used to determine if there were conversion problems during an export. It can either return detailed information about sub-document failures or a structure that describes areas of a conversion that may not have high fidelity with the original document.
Prototype
SCCERR EXExportStatus(VTHEXPORT hExport, VTDWORD dwStatusType, VTLPVOID pStatus)
Parameters
-
hExport: Export handle for the document.
-
dwStatusType: Specifies which status information should be filled in pStatus.
-
EXSTATUS_SUBDOC – fills in the EXSUBDOCSTATUS structure (only implemented in Search Export and XML Export)
-
EXSTATUS_INFORMATION - fills in the EXSTATUSINFORMATION structure.
-
-
pStatus: Either a pointer to a EXSUBDOCSTATUS or EXSTATUSINFORMATION data structure depending on the value of dwStatusType.
Return Values
SCCERR_OK: Returned if there were no problems. Otherwise, one of the other SCCERR_ values in sccerr.h is returned.
EXSUBDOCSTATUS Structure
The EXSUBDOCSTATUS structure is defined as follows:
typedef struct EXSUBDOCSTATUStag { VTDWORD dwSize; /* size of this structure */ VTDWORD dwSucceeded; /* number of sub documents that were converted */ VTDWORD dwFailed; /* number of sub documents that were not converted */ } EXSUBDOCSTATUS;
EXSTATUSINFORMATION Structure
The EXSTATUSINFORMATION structure is defined as follows:
typedef struct EXSTATUSINFORMATIONtag { VTDWORD dwVersion; /* version of this structure, currently EXSTATUSVERSION2 */ VTBOOL bMissingMap; /* a PDF text run was missing the toUnicode table */ VTBOOL bVerticalText; /* a vertical text run was present */ VTBOOL bTextEffects; /* unsupported text effects applied (i.e.Word Art)*/ VTBOOL bUnsupportedCompression; /* a graphic had an unsupported compression */ VTBOOL bUnsupportedColorSpace; /* a graphic had an unsupported color space */ VTBOOL bForms; /* a sub documents had forms */ VTBOOL bRightToLeftTables; /* a table had right to left columns */ VTBOOL bEquations; /* a file had equations*/ VTBOOL bAliasedFont; /* A font was missing, but a font alias was used */ VTBOOL bMissingFont; /* The desired font wasn't present on the system */ VTBOOL bSubDocFailed; /* a sub document was not converted */ VTBOOL bTypeThreeFont; /* a Type 3 Font was encountered */ VTBOOL bUnsupportedShading; /* an unsupported shading pattern was encountered */ VTBOOL bInvalidHTML; /* An HTML parse error, as defined by the W3C, was encountered. */ VTBOOL bVectorObjectLimit; /* This flag does not apply to Search Export */ VTBOOL bInvalidAnnotationNotApplied; /* This flag does not apply to Search Export */ } EXSTATUSINFORMATION;
#define EXSTATUSVERSION2 0X0002
Note:
When processing the main document, Search Export, HTML Export, and XML Export never use fonts, so bAliasedFont and bMissingFont will never report TRUE; however, when doing graphics conversions XML Export and HTML Export may use fonts, so bAliasedFont and bMissingFont may report TRUE.
bVectorObjectLimit applies only to WebView Export, and bInvalidAnnotationNotApplied applies only to Image Export, PDF Export, and Web View Export.