RecAPI
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Modules Pages
RecPDF Module

This is the "C" level API of RecPDFAPI. RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS. 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 ,
  PSR_ALLOW_EVERYTHING = 0
}
 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 rPdfOpStartEx (int sid, RPDF_OPERATION *Ophandle)
 Start a new PDF operation using a given Settings collection ID (sid).
 
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 PDFASMAPI rPdfOptOpen (LPCTSTR pFileName, LPCTSTR password, RPDF_DOC *handle)
 Open a PDF file for optimization.
 
RECERR PDFASMAPI rPdfOptAddCommandStr (RPDF_DOC handle, LPCTSTR command)
 Add an optimization command string to a handle.
 
RECERR PDFASMAPI rPdfOptimize (RPDF_DOC handle, LPCTSTR pOptFileName)
 Do the optimization process.
 

Detailed Description

This is the "C" level API of RecPDFAPI. RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.

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.

Enumeration Type Documentation

◆ RPDF_ENCRYPTION

Encryption type of a PDF file.

Enumerator
ENC_NO 

Not encrypted.

ENC_RC4 

RC4 algorithm.

ENC_AES 

AES algorithm.

◆ RPDF_RESTRICTIONS

PDF security restriction flags.

Enumerator
PSR_NO_PRINT 

Printing isn't allowed.

PSR_NO_HIPRINT 

Print the document only low resolution mode.

PSR_NO_COPY 

Can not copy the content to other document.

PSR_NO_EXTRACT_TEXT 

Extracting the content is prohibited. (For accessibility usings for disabled users.)

PSR_NO_EXTRACT_PAGES 

Extracting the pages is prohibited.

PSR_NO_CHANGE 

Modifying the content is prohibited.

PSR_NO_ASSEMBLE 

Document assemble is prohibited (can not insert, rotate, delete pages, and create bookmarks or thumbnails).

PSR_NO_ACROFORM 

Filling in form fields are prohibited.

PSR_NO_ANNOT 

Adding or modifying annotations are prohibited.

◆ RPDF_ROTATION

Page rotation.

Enumerator
PDFROT_NO 

No rotation.

PDFROT_LEFT 

Rotate counter clockwise.

PDFROT_RIGHT 

Rotate clockwise.

PDFROT_HALFTURN 

Rotate 180 degrees.

Function Documentation

◆ rPdfClose()

RECERR PDFASMAPI rPdfClose ( RPDF_DOC handle)

Close a PDF document.

Destroys the PDF document object.

Return values
RECERR
Parameters
[in]handleHandle of the PDF document.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
All unsaved data will be lost.
The handle won't be valid any more.
The specification of this function in C# is:
RECERR rPdfClose(IntPtr handle);
RECERR
Error codes.
Definition RECERR_doc.h:19
RECERR PDFASMAPI rPdfClose(RPDF_DOC handle)
Close a PDF document.
The specification of this function in Java is:
int rPdfClose(RPDF_DOC handle)
struct tagRPDF_DOC * RPDF_DOC
Handle of a PDF document.
Definition recpdf.h:48
The specification of this function in Python is:
def rPdfClose(handle: "RPDF_DOC") -> int

◆ rPdfCompact()

RECERR PDFASMAPI rPdfCompact ( LPCTSTR pInFileName,
LPCTSTR pOutFileName )

Compact a PDF document.

Save the compacted PDF document into a new file.

Return values
RECERR
Parameters
[in]pInFileNameFull path of the input file.
[in]pOutFileNameFull path of the output file.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfCompact(string sourceFileName, string destinationFileName);
RECERR PDFASMAPI rPdfCompact(LPCTSTR pInFileName, LPCTSTR pOutFileName)
Compact a PDF document.
The specification of this function in Java is:
int rPdfCompact(String pInFileName, String pOutFileName)
The specification of this function in Python is:
def rPdfCompact(pInFileName: str, pOutFileName: str) -> int

◆ rPdfFileHasText()

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.

Return values
RECERR
Parameters
[in]handleHandle of the PDF document.
[in]positionPage index in the PDF document.
[out]bHasTextExistence of searchable text in the page of the PDF document.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfFileHasText(DocumentHandle handle, uint position, out bool hasText);
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.
The specification of this function in Java is:
int rPdfFileHasText(RPDF_DOC handle, long position, boolean[] bHasText)
The specification of this function in Python is:
def rPdfFileHasText(handle: "RPDF_DOC", position: int) -> Tuple[int, bool]

◆ rPdfGetOp()

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.

Return values
RECERR
Parameters
[in]handleHandle of the PDF document.
[out]ophandleThe return value is the handle of the PDF operation if an PDF operation is assigned to the PDF document, otherwise NULL.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfGetOp(DocumentHandle handle, out OperationHandle ophandle);
RECERR PDFASMAPI rPdfGetOp(RPDF_DOC handle, RPDF_OPERATION *ophandle)
Get the PDF operation assigned to a PDF document.
The specification of this function in Java is:
int rPdfGetOp(RPDF_DOC handle, RPDF_OPERATION ophandle)
struct tagRPDF_OPERATION * RPDF_OPERATION
Handle of a PDF operation.
Definition recpdf.h:56
The specification of this function in Python is:
def rPdfGetOp(handle: "RPDF_DOC") -> Tuple[int, "RPDF_OPERATION"]

◆ rPdfGetPageCount()

RECERR PDFASMAPI rPdfGetPageCount ( RPDF_DOC handle,
size_t * pnPages )

Get the page count of a PDF document.

Return values
RECERR
Parameters
[in]handleHandle of the PDF document.
[out]pnPagesCount of pages in the PDF document.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfGetPageCount(DocumentHandle handle, out UIntPtr attribs);
RECERR PDFASMAPI rPdfGetPageCount(RPDF_DOC handle, size_t *pnPages)
Get the page count of a PDF document.
The specification of this function in Java is:
int rPdfGetPageCount(RPDF_DOC handle, long[] pnPages)
The specification of this function in Python is:
def rPdfGetPageCount(handle: "RPDF_DOC") -> Tuple[int, int]

◆ rPdfGetPath()

RECERR PDFASMAPI rPdfGetPath ( RPDF_DOC handle,
LPTSTR buffer,
size_t buflen )

Get the path of the PDF document.

Read the path string from the PDF file.

Return values
RECERR
Parameters
[in]handleHandle of the PDF document.
[out]bufferString buffer to store the full path of the PDF document.
[out]buflenLength of the buffer.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfGetPath(DocumentHandle handle, out string path)
RECERR PDFASMAPI rPdfGetPath(RPDF_DOC handle, LPTSTR buffer, size_t buflen)
Get the path of the PDF document.
The specification of this function in Java is:
int rPdfGetPath(RPDF_DOC handle, String[] buffer)
The specification of this function in Python is:
def rPdfGetPath(handle: "RPDF_DOC") -> Tuple[int, str]

◆ rPdfGetPDFSecurityInfo()

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.

Return values
RECERR
Parameters
[in]pFileNameFull path of the source file.
[out]encMethodEncryption method of the PDF file. (Can be NULL if not needed.)
[out]keySizeEncryption's key size. (Can be NULL if not needed.)
[out]secuRestrictionsRestrictions on the PDF file. (Can be NULL if not needed.)
[out]hasMasterPasswordWhether the PDF file has master password. (Can be NULL if not needed.)
[out]hasUserPasswordWhether the PDF file has user password. (Can be NULL if not needed.)
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
rPdfGetPDFSecurityInformation(string fileName, out Encryption encryption, out UIntPtr keySize, out Restrictions restrictions, out bool hasMasterPassword, out bool hasUserPassword)
The specification of this function in Java is:
int rPdfGetPDFSecurityInfo(String pFileName, RPDF_ENCRYPTION[] encMethod, long[] keySize, RPDF_RESTRICTIONS[] secuRestrictions, boolean[] hasMasterPassword, boolean[] hasUserPassword)
RPDF_ENCRYPTION
Encryption type of a PDF file.
Definition recpdf.h:71
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.
RPDF_RESTRICTIONS
PDF security restriction flags.
Definition recpdf.h:79
The specification of this function in Python is:
def rPdfGetPDFSecurityInfo(pFileName: str) -> Tuple[int, int, int, int, bool, bool]

◆ rPdfInit()

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.

Return values
RECERR
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
Before rPdfInit a kRecInit or RecInitPlus must be called to initialize the CSDK.
The specification of this function in C# is:
RECERR PDFASMAPI rPdfInit(void)
Initialize the RecPDF.
The specification of this function in Java is:
int rPdfInit()
The specification of this function in Python is:
def rPdfInit(csdkPath: Optional[str] = None) -> int

◆ rPdfOpAddFile()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]handleHandle of the PDF document.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
Once a PDF document is assigned to a PDF operation, there is no way to unassign it.
The specification of this function in C# is:
RECERR rPdfOpAddFile(OperationHandle operation, DocumentHandle docHandle);
RECERR PDFASMAPI rPdfOpAddFile(RPDF_OPERATION ophandle, RPDF_DOC handle)
Add a PDF document to the PDF operation.
The specification of this function in Java is:
int rPdfOpAddFile(RPDF_OPERATION ophandle, RPDF_DOC handle)
The specification of this function in Python is:
def rPdfOpAddFile(ophandle: "RPDF_OPERATION", handle: "RPDF_DOC") -> int

◆ rPdfOpCancel()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfOpCancel(IntPtr ophandle);
RECERR PDFASMAPI rPdfOpCancel(RPDF_OPERATION ophandle)
Cancel a PDF operation.
The specification of this function in Java is:
The specification of this function in Python is:
def rPdfOpCancel(ophandle: "RPDF_OPERATION") -> int

◆ rPdfOpCloseFileEnumeration()

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.

Return values
RECERR
Parameters
[in]enumeratorHandle of the PDF document enumerator.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfOpCloseFileEnumeration(IntPtr enumerator);
RECERR PDFASMAPI rPdfOpCloseFileEnumeration(RPDF_FILEENUMERATOR enumerator)
Close the enumeration of the assigned PDF documents in the PDF operation.
The specification of this function in Java is:
struct tagRPDF_FILEENUMERATOR * RPDF_FILEENUMERATOR
Handle of an enumerator for the PDF documents taking part in a PDF operation.
Definition recpdf.h:64
The specification of this function in Python is:
def rPdfOpCloseFileEnumeration(enumerator: "RPDF_FILEENUMERATOR") -> int

◆ rPdfOpCopyPages()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]desthandleHandle of the destination PDF document.
[in]destpositionStarting 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]srchandleHandle 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]PageIndexArrArray of page indices in the source PDF document.
[in]numpagesCount of pages to copy. This is the number of elements in the PageIndexArr array.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The command takes place when the PDF operation is executed.
After the call all functions will see as if the copy has been already taken place.
The specification of this function in C# is:
RECERR rPdfOpCopyPages(OperationHandle ophandle, DocumentHandle handle, uint position, DocumentHandle otherHandle, UIntPtr[] otherPositions)
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.
The specification of this function in Java is:
int rPdfOpCopyPages(RPDF_OPERATION ophandle, RPDF_DOC desthandle, long destposition, RPDF_DOC srchandle, long[] PageIndexArr)
The specification of this function in Python is:
def rPdfOpCopyPages(ophandle: "RPDF_OPERATION", desthandle: "RPDF_DOC", destposition: int, srchandle: "RPDF_DOC", PageIndexArr: "SizeTArray") -> int

◆ rPdfOpDeletePages()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]handleHandle of the PDF document.
[in]PageIndexArrArray of the page indices in the PDF document.
[in]numpagesCount of pages to delete. This is the number of elements in the PageIndexArr.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The command takes place when the PDF operation is executed.
After the call all functions will see as if the deletion has been already taken place.
The specification of this function in C# is:
RECERR rPdfOpDeletePages(OperationHandle operation, DocumentHandle handle, UIntPtr[] pageIndexArray)
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.
The specification of this function in Java is:
int rPdfOpDeletePages(RPDF_OPERATION ophandle, RPDF_DOC handle, long[] PageIndexArr)
The specification of this function in Python is:
def rPdfOpDeletePages(ophandle: "RPDF_OPERATION", handle: "RPDF_DOC", PageIndexArr: "SizeTArray") -> int

◆ rPdfOpen()

RECERR PDFASMAPI rPdfOpen ( LPCTSTR pFileName,
LPCTSTR password,
RPDF_DOC * handle )

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.

Return values
RECERR
Parameters
[in]pFileNameFull path of the source file.
[in]passwordPointer to the PDF password or NULL or empty string if no password is needed.
[out]handlePDF document handle.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfOpen(string fileName, string password, out DocumentHandle handle);
RECERR PDFASMAPI rPdfOpen(LPCTSTR pFileName, LPCTSTR password, RPDF_DOC *handle)
Open a PDF file.
The specification of this function in Java is:
int rPdfOpen(String pFileName, String password, RPDF_DOC handle)
The specification of this function in Python is:
def rPdfOpen(pFileName: str, password: str) -> Tuple[int, "RPDF_DOC"]

◆ rPdfOpExecute()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
There is no guarantee that all commands will be executed.
The specification of this function in C# is:
RECERR rPdfOpExecute(OperationHandle ophandle);
RECERR PDFASMAPI rPdfOpExecute(RPDF_OPERATION ophandle)
Execute a PDF operation.
The specification of this function in Java is:
The specification of this function in Python is:
def rPdfOpExecute(ophandle: "RPDF_OPERATION") -> int

◆ rPdfOpGetFirstFile()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[out]handleHandle of the first PDF document.
[out]numfilesCount of assigned PDF documents in the PDF operation.
[out]enumeratorNew enumerator handle. This handle can be used to continue the enumeration with the rPdfOpGetNextFile.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
By the time when the enumeration takes place the PDF operation object or the referenced PDF documents may be destroyed. If the PDF operation object is destroyed a referenced PDF document may be attached to another PDF operation.
The specification of this function in C# is:
RECERR rPdfOpGetFirstFile(OperationHandle ophandle, out DocumentHandle handle, out UIntPtr numfiles, out FileEnumeratorHandle enumerator);
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.
The specification of this function in Java is:
int rPdfOpGetFirstFile(RPDF_OPERATION ophandle, RPDF_DOC handle, long[] numfiles, RPDF_FILEENUMERATOR enumerator)
The specification of this function in Python is:
def rPdfOpGetFirstFile(ophandle: "RPDF_OPERATION") -> Tuple[int, "RPDF_DOC", int, "RPDF_FILEENUMERATOR"]

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

Return values
RECERR
Parameters
[in]enumeratorHandle of the PDF document enumerator.
[out]handleAssigned PDF document in the PDF operation.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfOpGetNextFile(FileEnumeratorHandle enumerator, out DocumentHandle handle);
RECERR PDFASMAPI rPdfOpGetNextFile(RPDF_FILEENUMERATOR enumerator, RPDF_DOC *handle)
Get the next assigned PDF document of a PDF operation.
The specification of this function in Java is:
The specification of this function in Python is:
def rPdfOpGetNextFile(enumerator: "RPDF_FILEENUMERATOR") -> Tuple[int, "RPDF_DOC"]

◆ rPdfOpInsertHPAGEs()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]desthandleHandle of the destination PDF document.
[in]destpositionStarting 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]srcpagesArray of pages given by HPAGEs.
[in]srcpagecountCount of HPAGEs to insert. This is the number of elements in the srcpages array.
[in]bImageOnlyIf this parameter is true, the command inserts only the images without the recognized text.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The command takes place when the PDF operation is executed.
The HPAGEs can free after the end of the operation.
After the call all functions will see as if the insertion has been already taken place.
The specification of this function in C# is:
RECERR rPdfOpInsertHPAGEs(OperationHandle ophandle, DocumentHandle handle, uint position, IntPtr[] srcpages, bool imageOnly)
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.
The specification of this function in Java is:
int rPdfOpInsertHPAGEs(RPDF_OPERATION ophandle, RPDF_DOC desthandle, long destposition, HPAGE[] srcpages, boolean bImageOnly)
struct RECPAGESTRUCT * HPAGE
Handle of a page in memory.
Definition KernelApi.h:289
The specification of this function in Python is:
def rPdfOpInsertHPAGEs(ophandle: "RPDF_OPERATION", desthandle: "RPDF_DOC", destposition: int, srcpages: "HPAGE", bImageOnly: bool) -> int

◆ rPdfOpMergeTextToPages()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]desthandleHandle of the destination PDF document.
[in]destpositionStarting 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]srcpagesArray of pages given by HPAGEs.
[in]srcpagecountCount of HPAGEs to insert. This is the number of elements in the srcpages array.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The command takes place when the PDF operation is executed.
After this function call, the HPAGE can free by the caller.
After the call all functions will see as if the insertion has been already taken place.
The specification of this function in C# is:
RECERR rPdfOpMergeTextToPages(OperationHandle ophandle, DocumentHandle handle, uint destposition, IntPtr[] srcpages)
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.
The specification of this function in Java is:
int rPdfOpMergeTextToPages(RPDF_OPERATION ophandle, RPDF_DOC desthandle, long destposition, HPAGE[] srcpages)
The specification of this function in Python is:
def rPdfOpMergeTextToPages(ophandle: "RPDF_OPERATION", desthandle: "RPDF_DOC", destposition: int, srcpages: "HPAGE") -> int

◆ rPdfOpMovePages()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]handleHandle of the PDF document.
[in]destpositionThe 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]PageIndexArrArray of page indices in the source PDF document.
[in]numpagesCount of pages to copy. This is the number of elements in the PageIndexArr array.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The command takes place when the PDF operation is executed.
After the call all functions will see as if the move has been already taken place.
The specification of this function in C# is:
RECERR rPdfOpMovePages(OperationHandle ophandle, DocumentHandle handle, uint position, UIntPtr[] otherPositions)
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.
The specification of this function in Java is:
int rPdfOpMovePages(RPDF_OPERATION ophandle, RPDF_DOC handle, long destposition, long[] PageIndexArr)
The specification of this function in Python is:
def rPdfOpMovePages(ophandle: "RPDF_OPERATION", handle: "RPDF_DOC", destposition: int, PageIndexArr: "SizeTArray") -> int

◆ rPdfOpRotatePage()

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.

Return values
RECERR
Parameters
[in]ophandleHandle of the PDF operation.
[in]handleHandle of the PDF document.
[in]positionPage index in the PDF document.
[in]rotationHow much rotate the page.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The command takes place when the PDF operation is executed.
After the call all functions will see as if the rotation has been already taken place.
If the page is a part of a page object, then it will be removed from the page object.
The specification of this function in C# is:
RECERR rPdfOpRotatePage(OperationHandle operation, DocumentHandle handle, uint position, Rotation rotation);
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.
The specification of this function in Java is:
int rPdfOpRotatePage(RPDF_OPERATION ophandle, RPDF_DOC handle, long position, RPDF_ROTATION rotation)
RPDF_ROTATION
Page rotation.
Definition recpdf.h:94
The specification of this function in Python is:
def rPdfOpRotatePage(ophandle: "RPDF_OPERATION", handle: "RPDF_DOC", position: int, rotation: int) -> int

◆ rPdfOpStart()

RECERR PDFASMAPI rPdfOpStart ( RPDF_OPERATION * Ophandle)

Start a new PDF operation.

Create a new PDF operation object.

Return values
RECERR
Parameters
[out]OphandleHandle of the new PDF operation.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfOpStart(out OperationHandle ophandle);
RECERR PDFASMAPI rPdfOpStart(RPDF_OPERATION *Ophandle)
Start a new PDF operation.
The specification of this function in Java is:
The specification of this function in Python is:
def rPdfOpStart() -> Tuple[int, "RPDF_OPERATION"]

◆ rPdfOpStartEx()

RECERR PDFASMAPI rPdfOpStartEx ( int sid,
RPDF_OPERATION * Ophandle )

Start a new PDF operation using a given Settings collection ID (sid).

Create a new PDF operation object.

Return values
RECERR
Parameters
[in]sidSettings Collection ID.
[out]OphandleHandle of the new PDF operation.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The specification of this function in C# is:
RECERR rPdfOpStartEx(int sid, out OperationHandle ophandle);
RECERR PDFASMAPI rPdfOpStartEx(int sid, RPDF_OPERATION *Ophandle)
Start a new PDF operation using a given Settings collection ID (sid).
The specification of this function in Java is:
int rPdfOpStartEx(int sid, RPDF_OPERATION Ophandle)
The specification of this function in Python is:
def rPdfOpStartEx(int sid) -> Tuple[int, "RPDF_OPERATION"]

◆ rPdfOptAddCommandStr()

RECERR PDFASMAPI rPdfOptAddCommandStr ( RPDF_DOC handle,
LPCTSTR command )

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

Return values
RECERR
Parameters
[in]handleHandle of the PDF operation coming from rPdfOptOpen.
[in]commandCommands, see the command descriptions.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
After collecting the required commands calling this function sequentially they can be performed by calling rPdfOptimize.
The specification of this function in C# is:
RECERR rPdfOptAddCommandStr(DocumentHandle Handle, string Command);
RECERR PDFASMAPI rPdfOptAddCommandStr(RPDF_DOC handle, LPCTSTR command)
Add an optimization command string to a handle.
The specification of this function in Java is:
int rPdfOptAddCommandStr(RPDF_DOC handle, String command)
The specification of this function in Python is:
def rPdfOptAddCommandStr(handle: "RPDF_DOC", command: str) -> int

◆ rPdfOptimize()

RECERR PDFASMAPI rPdfOptimize ( RPDF_DOC handle,
LPCTSTR pOptFileName )

Do the optimization process.

Return values
RECERR
Parameters
[in]handleHandle of the PDF operation coming from rPdfOptOpen.
[in]pOptFileNameFull path of the optimized output file.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The commands to be performed during optimization can be added by calling rPdfOptAddCommandStr.
The specification of this function in C# is:
RECERR rPdfOptimize(DocumentHandle Handle, string OptFileName);
RECERR PDFASMAPI rPdfOptimize(RPDF_DOC handle, LPCTSTR pOptFileName)
Do the optimization process.
The specification of this function in Java is:
int rPdfOptimize(RPDF_DOC handle, String pOptFileName)
The specification of this function in Python is:
def rPdfOptimize(handle: "RPDF_DOC", pOptFileName: str) -> int

◆ rPdfOptOpen()

RECERR PDFASMAPI rPdfOptOpen ( LPCTSTR pFileName,
LPCTSTR password,
RPDF_DOC * handle )

Open a PDF file for optimization.

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

Return values
RECERR
Parameters
[in]pFileNameFull path of the source file.
[in]passwordPointer to the PDF password or NULL or empty string if no password is needed.
[out]handlePDF document handle.
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
The handle should be closed by calling rPdfClose.
The specification of this function in C# is:
RECERR rPdfOptOpen(string Path, string Password, out DocumentHandle Handle);
RECERR PDFASMAPI rPdfOptOpen(LPCTSTR pFileName, LPCTSTR password, RPDF_DOC *handle)
Open a PDF file for optimization.
The specification of this function in Java is:
int rPdfOptOpen(String pFileName, String password, RPDF_DOC handle)
The specification of this function in Python is:
def rPdfOptOpen(pFileName: str, password: str) -> Tuple[int, "RPDF_DOC"]

◆ rPdfQuit()

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.

Return values
RECERR
Note
RecPDF API-level of CSDK is supported on: Windows, Linux, MacOS.
After rPdfQuit a kRecQuit or RecQuitPlus must be called to shut down the CSDK.
The specification of this function in C# is:
RECERR PDFASMAPI rPdfQuit(void)
Uninitialize the RecPDF.
The specification of this function in Java is:
int rPdfQuit()
The specification of this function in Python is:
def rPdfQuit() -> int