RecAPI
|
This is the "C" level API of RecPDFAPI. RecPDF API-level of CSDK is supported on: Windows, Linux, Mac OS X. More...
Typedefs | |
typedef struct tagRPDF_DOC * | RPDF_DOC |
Handle of a PDF document. | |
typedef struct tagRPDF_OPERATION * | RPDF_OPERATION |
Handle of a PDF operation. | |
typedef struct tagRPDF_FILEENUMERATOR * | RPDF_FILEENUMERATOR |
Handle of an enumerator for the PDF documents taking part in a PDF operation. | |
Enumerations | |
enum | RPDF_ENCRYPTION { ENC_NO, ENC_RC4, ENC_AES } |
Encryption type of a PDF file. More... | |
enum | RPDF_RESTRICTIONS { PSR_NO_PRINT = 0x00000100, PSR_NO_HIPRINT = 0x00000200, PSR_NO_COPY = 0x00000400, PSR_NO_EXTRACT_TEXT = 0x00000800, PSR_NO_EXTRACT_PAGES = 0x00001000, PSR_NO_CHANGE = 0x00002000, PSR_NO_ASSEMBLE = 0x00004000, PSR_NO_ACROFORM = 0x00008000, PSR_NO_ANNOT = 0x00010000 } |
PDF security restriction flags. More... | |
enum | RPDF_ROTATION { PDFROT_NO = 0, PDFROT_LEFT, PDFROT_RIGHT, PDFROT_HALFTURN } |
Page rotation. More... | |
enum | PDF_Version |
PDF version. | |
enum | PDFA_Version |
PDFA version. | |
Functions | |
RECERR PDFASMAPI | rPdfInit (void) |
Initialize the RecPDF. | |
RECERR PDFASMAPI | rPdfQuit (void) |
Uninitialize the RecPDF. | |
RECERR PDFASMAPI | rPdfOpen (LPCTSTR pFileName, LPCTSTR password, RPDF_DOC *handle) |
Open a PDF file. | |
RECERR PDFASMAPI | rPdfCompact (LPCTSTR pInFileName, LPCTSTR pOutFileName) |
Compact a PDF document. | |
RECERR PDFASMAPI | rPdfClose (RPDF_DOC handle) |
Close a PDF document. | |
RECERR PDFASMAPI | rPdfGetOp (RPDF_DOC handle, RPDF_OPERATION *ophandle) |
Get the PDF operation assigned to a PDF document. | |
RECERR PDFASMAPI | rPdfGetPath (RPDF_DOC handle, LPTSTR buffer, size_t buflen) |
Get the path of the PDF document. | |
RECERR PDFASMAPI | rPdfFileHasText (RPDF_DOC handle, size_t position, bool *bHasText) |
Check if a page of the PDF document does have or doesn't have searchable text. | |
RECERR PDFASMAPI | rPdfGetPageCount (RPDF_DOC handle, size_t *pnPages) |
Get the page count of a PDF document. | |
RECERR PDFASMAPI | rPdfOpStart (RPDF_OPERATION *Ophandle) |
Start a new PDF operation. | |
RECERR PDFASMAPI | rPdfOpAddFile (RPDF_OPERATION ophandle, RPDF_DOC handle) |
Add a PDF document to the PDF operation. | |
RECERR PDFASMAPI | rPdfOpGetFirstFile (RPDF_OPERATION ophandle, RPDF_DOC *handle, size_t *numfiles, RPDF_FILEENUMERATOR *enumerator) |
Get the first assigned PDF document of a PDF operation. | |
RECERR PDFASMAPI | rPdfOpGetNextFile (RPDF_FILEENUMERATOR enumerator, RPDF_DOC *handle) |
Get the next assigned PDF document of a PDF operation. | |
RECERR PDFASMAPI | rPdfOpCloseFileEnumeration (RPDF_FILEENUMERATOR enumerator) |
Close the enumeration of the assigned PDF documents in the PDF operation. | |
RECERR PDFASMAPI | rPdfOpRotatePage (RPDF_OPERATION ophandle, RPDF_DOC handle, size_t position, RPDF_ROTATION rotation) |
Rotate a page in a PDF document as a part of a PDF operation. | |
RECERR PDFASMAPI | rPdfOpDeletePages (RPDF_OPERATION ophandle, RPDF_DOC handle, const size_t *PageIndexArr, size_t numpages) |
Delete one or more pages in a PDF document as a part of a PDF operation. | |
RECERR PDFASMAPI | rPdfOpCopyPages (RPDF_OPERATION ophandle, RPDF_DOC desthandle, size_t destposition, RPDF_DOC srchandle, const size_t *PageIndexArr, size_t numpages) |
Copy pages as a part of a PDF operation. | |
RECERR PDFASMAPI | rPdfOpMovePages (RPDF_OPERATION ophandle, RPDF_DOC handle, size_t destposition, const size_t *PageIndexArr, size_t numpages) |
Move pages as a part of a PDF operation. | |
RECERR PDFASMAPI | rPdfOpCancel (RPDF_OPERATION ophandle) |
Cancel a PDF operation. | |
RECERR PDFASMAPI | rPdfOpExecute (RPDF_OPERATION ophandle) |
Execute a PDF operation. | |
RECERR PDFASMAPI | rPdfOpInsertHPAGEs (RPDF_OPERATION ophandle, RPDF_DOC desthandle, size_t destposition, const HPAGE *srcpages, size_t srcpagecount, bool bImageOnly) |
Insert pages to the PDF given by HPAGE handles. | |
RECERR PDFASMAPI | rPdfOpMergeTextToPages (RPDF_OPERATION ophandle, RPDF_DOC desthandle, size_t destposition, const HPAGE *srcpages, size_t srcpagecount) |
Insert the text content of the given HPAGE handles to the specified PDF pages. | |
RECERR PDFASMAPI | rPdfGetPDFSecurityInfo (LPCTSTR pFileName, RPDF_ENCRYPTION *encMethod, size_t *keySize, RPDF_RESTRICTIONS *secuRestrictions, bool *hasMasterPassword, bool *hasUserPassword) |
Get PDF encryption information without opening it. | |
RECERR PDFASMCALL | rPdfOptOpen (LPCTSTR pFileName, LPCTSTR password, RPDF_DOC *handle) |
Open a PDF file. | |
RECERR PDFASMCALL | rPdfOptAddCommandStr (RPDF_DOC handle, LPCTSTR command) |
Add an optimization command string to a handle. | |
RECERR PDFASMCALL | rPdfOptimize (RPDF_DOC handle, LPCTSTR pOptFileName) |
Do the optimization process. |
This is the "C" level API of RecPDFAPI. RecPDF API-level of CSDK is supported on: Windows, Linux, Mac OS X.
This is the "C" level Page Oriented PDF File Manipulation API of OmniPage CSDK.
This part of RecAPI is an extension can be used both with KernelAPI and with RecAPIPlus. One of them should be initialized before initialization of RecPDF.
List of header files of this module:
The library file that should be linked is recpdf.lib, but there is an alternative solution: the dynamic linking using RecPDFS.
enum RPDF_ENCRYPTION |
enum RPDF_RESTRICTIONS |
PDF security restriction flags.
enum RPDF_ROTATION |
Close a PDF document.
Destroys the PDF document object.
RECERR |
[in] | handle | Handle of the PDF document. |
RECERR PDFASMAPI rPdfCompact | ( | LPCTSTR | pInFileName, |
LPCTSTR | pOutFileName | ||
) |
Compact a PDF document.
Save the compacted PDF document into a new file.
RECERR |
[in] | pInFileName | Full path of the input file. |
[in] | pOutFileName | Full path of the output file. |
Check if a page of the PDF document does have or doesn't have searchable text.
RECERR |
[in] | handle | Handle of the PDF document. |
[in] | position | Page index in the PDF document. |
[out] | bHasText | Existence of searchable text in the page of the PDF document. |
RECERR PDFASMAPI rPdfGetOp | ( | RPDF_DOC | handle, |
RPDF_OPERATION * | ophandle | ||
) |
Get the PDF operation assigned to a PDF document.
At a time only one PDF operation can be assigned to a PDF document. If there is such an PDF operation, this function will give it back. If there is no such PDF operation NULL will be returned.
RECERR |
[in] | handle | Handle of the PDF document. |
[out] | ophandle | The return value is the handle of the PDF operation if an PDF operation is assigned to the PDF document, otherwise NULL. |
Get the page count of a PDF document.
RECERR |
[in] | handle | Handle of the PDF document. |
[out] | pnPages | Count of pages in the PDF document. |
Get the path of the PDF document.
Read the path string from the PDF file.
RECERR |
[in] | handle | Handle of the PDF document. |
[out] | buffer | String buffer to store the full path of the PDF document. |
[out] | buflen | Length of the buffer. |
RECERR PDFASMAPI rPdfGetPDFSecurityInfo | ( | LPCTSTR | pFileName, |
RPDF_ENCRYPTION * | encMethod, | ||
size_t * | keySize, | ||
RPDF_RESTRICTIONS * | secuRestrictions, | ||
bool * | hasMasterPassword, | ||
bool * | hasUserPassword | ||
) |
Get PDF encryption information without opening it.
RECERR |
[in] | pFileName | Full path of the source file. |
[out] | encMethod | Encryption method of the PDF file. (Can be NULL if not needed.) |
[out] | keySize | Encryption's key size. (Can be NULL if not needed.) |
[out] | secuRestrictions | Restrictions on the PDF file. (Can be NULL if not needed.) |
[out] | hasMasterPassword | Whether the PDF file has master password. (Can be NULL if not needed.) |
[out] | hasUserPassword | Whether the PDF file has user password. (Can be NULL if not needed.) |
RECERR PDFASMAPI rPdfInit | ( | void | ) |
Initialize the RecPDF.
The rPdfInit starts the PDF assembler SDK. All RecPDF functions must be called between an rPdfInit and an rPdfQuit calls.
RECERR |
RECERR PDFASMAPI rPdfOpAddFile | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | handle | ||
) |
Add a PDF document to the PDF operation.
A PDF operation is able to use only those PDF document whose are assigned to it.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | handle | Handle of the PDF document. |
RECERR PDFASMAPI rPdfOpCancel | ( | RPDF_OPERATION | ophandle | ) |
Cancel a PDF operation.
Destroys a PDF operation without executing it. This PDF operation handle cannot be used anymore. All page objects will be freed up and cannot be used anymore. All PDF documents will show the same state as before the PDF operation has started.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
RECERR PDFASMAPI rPdfOpCloseFileEnumeration | ( | RPDF_FILEENUMERATOR | enumerator | ) |
Close the enumeration of the assigned PDF documents in the PDF operation.
Destroys the enumerator of the assigned PDF documents.
RECERR |
[in] | enumerator | Handle of the PDF document enumerator. |
RECERR PDFASMAPI rPdfOpCopyPages | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | desthandle, | ||
size_t | destposition, | ||
RPDF_DOC | srchandle, | ||
const size_t * | PageIndexArr, | ||
size_t | numpages | ||
) |
Copy pages as a part of a PDF operation.
Add a copy page command to a PDF operation. It can copy pages from a PDF document to another PDF document or inside a single PDF document.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | desthandle | Handle of the destination PDF document. |
[in] | destposition | Starting page index in the destination PDF document. The first copied page will get this page index. All other copied pages will be copied continually after the first one. If this equals to the count of pages of the destination PDF document or (size_t)-1, then the new pages will be appended to the PDF document. |
[in] | srchandle | Handle of the source PDF document. It can be the same as the desthandle. If it is NULL, then the source document will be the same as the destination. |
[in] | PageIndexArr | Array of page indices in the source PDF document. |
[in] | numpages | Count of pages to copy. This is the number of elements in the PageIndexArr array. |
RECERR PDFASMAPI rPdfOpDeletePages | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | handle, | ||
const size_t * | PageIndexArr, | ||
size_t | numpages | ||
) |
Delete one or more pages in a PDF document as a part of a PDF operation.
Add a page delete command to a PDF operation.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | handle | Handle of the PDF document. |
[in] | PageIndexArr | Array of the page indices in the PDF document. |
[in] | numpages | Count of pages to delete. This is the number of elements in the PageIndexArr. |
Open a PDF file.
Create a PDF document object, and assign an existing PDF file to it. Then gives back a handle for the PDF document.
RECERR |
[in] | pFileName | Full path of the source file. |
[in] | password | Pointer to the PDF password or NULL or empty string if no password is needed. |
[out] | handle | PDF document handle. |
RECERR PDFASMAPI rPdfOpExecute | ( | RPDF_OPERATION | ophandle | ) |
Execute a PDF operation.
Execute a PDF operation and after the execution destroy it. This PDF operation handle cannot be used anymore. All page objects will be freed up and cannot be used anymore.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
RECERR PDFASMAPI rPdfOpGetFirstFile | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC * | handle, | ||
size_t * | numfiles, | ||
RPDF_FILEENUMERATOR * | enumerator | ||
) |
Get the first assigned PDF document of a PDF operation.
Start the enumeration of the assigned PDF document of a PDF operation. The created file enumerator must be freed up after use with the rPdfOpCloseFileEnumeration function call.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[out] | handle | Handle of the first PDF document. |
[out] | numfiles | Count of assigned PDF documents in the PDF operation. |
[out] | enumerator | New enumerator handle. This handle can be used to continue the enumeration with the rPdfOpGetNextFile. |
RECERR PDFASMAPI rPdfOpGetNextFile | ( | RPDF_FILEENUMERATOR | enumerator, |
RPDF_DOC * | handle | ||
) |
Get the next assigned PDF document of a PDF operation.
Step the enumerator of the assigned PDF document and give back the next one.
RECERR |
[in] | enumerator | Handle of the PDF document enumerator. |
[out] | handle | Assigned PDF document in the PDF operation. |
RECERR PDFASMAPI rPdfOpInsertHPAGEs | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | desthandle, | ||
size_t | destposition, | ||
const HPAGE * | srcpages, | ||
size_t | srcpagecount, | ||
bool | bImageOnly | ||
) |
Insert pages to the PDF given by HPAGE handles.
Add an insert HPAGE command to a PDF operation. It can insert pages to a PDF document by HPAGE.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | desthandle | Handle of the destination PDF document. |
[in] | destposition | Starting page index in the destination PDF document. The first inserted page will get this page index. All other inserted pages will be inserted continually after the first one. If this equals to the count of pages of the destination PDF document or (size_t)-1, then the new pages will be appended to the PDF document. |
[in] | srcpages | Array of pages given by HPAGEs. |
[in] | srcpagecount | Count of HPAGEs to insert. This is the number of elements in the srcpages array. |
[in] | bImageOnly | If this parameter is true , the command inserts only the images without the recognized text. |
RECERR PDFASMAPI rPdfOpMergeTextToPages | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | desthandle, | ||
size_t | destposition, | ||
const HPAGE * | srcpages, | ||
size_t | srcpagecount | ||
) |
Insert the text content of the given HPAGE handles to the specified PDF pages.
Add a Make Pages Searchable command to a PDF operation. It can merge the text content of a HPAGE to the specified pages.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | desthandle | Handle of the destination PDF document. |
[in] | destposition | Starting page index in the destination PDF document. The first searchable page will get this page index. All other searchable pages will continually after the first one. |
[in] | srcpages | Array of pages given by HPAGEs. |
[in] | srcpagecount | Count of HPAGEs to insert. This is the number of elements in the srcpages array. |
RECERR PDFASMAPI rPdfOpMovePages | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | handle, | ||
size_t | destposition, | ||
const size_t * | PageIndexArr, | ||
size_t | numpages | ||
) |
Move pages as a part of a PDF operation.
Add a move page command to a PDF operation. It can move pages inside a single PDF document.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | handle | Handle of the PDF document. |
[in] | destposition | The starting page index. This will be the page index of the first moved page. All other move pages will be moved continually after the first one. If this equals to the count of pages of the destination PDF document or (size_t)-1, then the new pages will be appended to the PDF document. |
[in] | PageIndexArr | Array of page indices in the source PDF document. |
[in] | numpages | Count of pages to copy. This is the number of elements in the PageIndexArr array. |
RECERR PDFASMAPI rPdfOpRotatePage | ( | RPDF_OPERATION | ophandle, |
RPDF_DOC | handle, | ||
size_t | position, | ||
RPDF_ROTATION | rotation | ||
) |
Rotate a page in a PDF document as a part of a PDF operation.
Add a page rotate command to a PDF operation.
RECERR |
[in] | ophandle | Handle of the PDF operation. |
[in] | handle | Handle of the PDF document. |
[in] | position | Page index in the PDF document. |
[in] | rotation | How much rotate the page. |
RECERR PDFASMAPI rPdfOpStart | ( | RPDF_OPERATION * | Ophandle | ) |
Start a new PDF operation.
Create a new PDF operation object.
RECERR |
[out] | Ophandle | Handle of the new PDF operation. |
Add an optimization command string to a handle.
See the possible command strings in the RecPDF help! You can specify more command strings by calling this function more than once
RECERR |
[in] | handle | Handle of the PDF operation. |
[in] | command | Commands, see the command descriptions. |
Do the optimization process.
RECERR |
[in] | handle | Handle of the PDF operation. |
[in] | pOptFileName | Full path of the optimized output file. |
Open a PDF file.
Create a PDF document object, and assign an existing PDF file to it. Then gives back a handle for the PDF document. This handle can be used only for PDF optimalization. Do not add to an Operation
RECERR |
[in] | pFileName | Full path of the source file. |
[in] | password | Pointer to the PDF password or NULL or empty string if no password is needed. |
[out] | handle | PDF document handle. |
RECERR PDFASMAPI rPdfQuit | ( | void | ) |
Uninitialize the RecPDF.
The rPdfQuit stops the PDF assembler SDK. All RecPDF functions must be called between an rPdfInit and an rPdfQuit calls.
RECERR |