/*-----------------------------------------------------------------------------*/ /*! ** \file PdfImpositionLib.h ** \author © 2000 callas software gmbh ** \author Andreas Dippe ** \date created 06.02.2001 ** \brief The header file "PdfImpositionLib.h" declares the C API for the PDFengine Imposition Library DLL. For the sake of disambiguity various data types are included the header file "typedefinition.h". */ /*-----------------------------------------------------------------------------*/ #ifndef _PDFIMPOSITIONLIB_H #define _PDFIMPOSITIONLIB_H #include "PdfImpositionTypes.h" #if defined(__cplusplus) extern "C" { #endif /*defined(__cplusplus)*/ #if CCW_OS == CCW_OS_WIN # if CALS_PDFIMPOSITION_DLL # define DECL_PREFIX __declspec(dllexport) # elif CALS_PDFIMPOSITION_DLL_IMPORT # define DECL_PREFIX __declspec(dllimport) # else /* CALS_PDFIMPOSITION_DLL_IMPORT */ # define DECL_PREFIX extern # endif #elif defined(__APPLE__) || defined(macintosh) # if defined( __GNUG__ ) && (__GNUG__ >= 4) && defined( CALS_PDFIMPOSITION_DLL) # define DECL_PREFIX __attribute__ ((visibility("default"))) # else # define DECL_PREFIX # if defined(__MWERKS__) # pragma export on # endif # endif /* defined( __GNUG__ ) && (__GNUG__ >= 4) && defined( CALS_PDFIMPOSITION_DLL) */ #elif defined( unix) # define DECL_PREFIX #else # error "here define the platform dependent DECL_PREFIX macro!" #endif /*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/ /*! \brief Initialize PDFengine Imposition Library DLL. \param keycode is a callas keycode to enable access to this library \param pathtolib complete path to the library \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details).

*/ DECL_PREFIX IPL_int32_t IPL_PDFImpositionDLLInit( const IPL_sys_char_t* keycode , const IPL_Path_t* pathtolib); /*-----------------------------------------------------------------------------*/ /*! \brief Returns the version for PDFengine Imposition Library DLL. \return The value for the version number of the DLL. The high word carries the major version number; the low word carries the minor version number. A value like "0x00020009" means that the major version number is 2, and the minor version number is 9.
The current version is 0x00020006, equal to V2.06 */ DECL_PREFIX IPL_int32_t IPL_GetPDFImpositionDLLVersion(); /*-----------------------------------------------------------------------------*/ /*! \brief Returns a human readable error description for an error code returned by the pdfImpositionLibrary DLL. In order to work properly a language DLL must have been loaded (which will only work when it has been installed in the same directory where the pdfImpositionLibrary DLL resides). \param errcode Error code, as returned from any of the DLL functions \param errstr INPUT: Pointer to a C string buffer that will receive the error string.
OUTPUT: Error string given that the error code was known and the language DLL could be loaded. \param len Size of the C string buffer including the terminating NULL character \param lang requests a specific language for the error string; the following codes are currently supported:
0 = English
1 = German
2 = French 3 = Spanish 4 = Italian 5 = Japanese \return The function returns true, if the requested resource is known and ist name could be copied into the errstr character array. */ DECL_PREFIX IPL_bool_t IPL_GetErrorStringFromErrorCode( IPL_int32_t errcode , IPL_utf8_char_t* errstr , IPL_int32_t len , IPL_int32_t lang); /*-----------------------------------------------------------------------------*/ /*! \brief Returns the name of a resource inserted into a PDF by pdfImpositionLibrary. \param type Indicates the type of the respective resource; must be one of the IPL_CALSRESOURCETYPE enum. \param name INPUT: character array that will receive the resource name.
OUTPUT: resource name as used in the PDF file. \return The function returns true, if the requested resource is known and its name could be copied into the name character array.

\note Currently only two resources may be added by the pdfImpositionLibrary DLL: the font Courier and the registration color space "All". In order to use these in a private piece of PDF code it is necessary to reference them by name. As only the PDFengine Imposition Library "knows" this name, the name has to be retrieved using this function. */ DECL_PREFIX IPL_bool_t IPL_GetCALSResourceNames( IPL_CALSRESOURCETYPE type , IPL_TCALSRESNAME name); /*-----------------------------------------------------------------------------*/ /*! \brief Installs a callback function in the PDFengine Imposition Library in order to provide feedback for a status display. This progress function has only effect in the three functions: "PDFDocument_ListContents", "PDFDocument_ListContents2" and "IPL_PDFOutputStream_Close". \param fct Pointer to the callback function must be of type IPL_PROGRESSFUNCTION. \param cbparam pointer value that will be input in the cbparam parameter of the callback function whenever it is called. \return Returns a pointer to the previously installed callback function.

\note The callback function will be called when creating previews as well as when analysing a PDF file. It will not be called when creating sheet files or sheets or when positioning objects onto sheets. The parameters for the callback function have the following semantics:
lowrange - lower limit of the range of values
highrange - upper limit of the range of values
counter - value between lower and upper limit that indicates the progress
cbparam - the pointer value as input when installing the callback function */ DECL_PREFIX IPL_PROGRESSFUNCTION IPL_SetProgressFunction( IPL_PROGRESSFUNCTION fct , void* cbparam); /*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/ /*! \brief Same as PDFDocument_ListContents, but in addition indicates where to put temporary files which the pdfImpositionLibrary needs to create. \param pdffile character pointer to the complete path to the PDF file to be analysed \param infofile character pointer to the complete path for the results file \param tmpfpath Path to store all temporary files into. If this parameter is NULL, then the platform default path was used. \param infoformat set the format of the info file see IPL_EInfoFormat enum. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode, it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.13 */ DECL_PREFIX IPL_int32_t IPL_PDFDocument_ListContents( const IPL_Path_t* pdffile , const IPL_Path_t* infofile , const IPL_Path_t* tmpfpath , IPL_EInfoFormat infoformat); /*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/ /*! \brief Same as PDFDocument_ListContents, but in addition indicates where to put temporary files which the pdfImpositionLibrary needs to create. \param pdffile character pointer to the complete path to the PDF file to be analysed \param pagenum The starting page index, first page starting as zero. \param fct Pointer to the callback function must be of type IPL_EnumPagePropertyCB. \param data void poitner that will be input in the data parameter of the callback function whenever it is called. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode, it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 2.2 */ DECL_PREFIX IPL_int32_t IPL_PDFDocument_EnumPageProperties( const IPL_Path_t* pdffile , IPL_uint32_t pagenum , IPL_EnumPagePropertyCB fct , void* data); /*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/ /*! \brief Creates a preview for every page in a PDF file, if Adobe Acrobat is available and a special preview maker plug-in is installed. \param pdffile character pointer to the complete path for the PDF file \param previewfolder character pointer to the complete path for the folder where preview files shall be written to \param lpcrpreview pointer to a IPL_TCREATEPREVIEW structure. \param IPL_TCREATEPREVIEW.size size of structure in bytes; sizeof(IPL_TCREATEPREVIEW) \param IPL_TCREATEPREVIEW.resolution any value between 72 and 300; indicates the requested resolution of the preview \param IPL_TCREATEPREVIEW.type indicates the type of the requested preview; value must be one of the IPL_PREVIEWTYPE enum; currently only the values "PVT_BMP" and "PVT_JFIF" are supported. \param IPL_TCREATEPREVIEW.prefix contains an optional prefix that will be prepended to the preview's file name; e.g.. "MyPreview_" \param IPL_TCREATEPREVIEW.suffix contains an optinal suffix that will be appended to the preview's file name; e.g. ".BMP" \param IPL_TCREATEPREVIEW.digits indicates the number of digits that shall be used for numbering the previews created from a PDF, e.g. using '5' this will yield filenames like "MyPreview_00001.BMP","MyPreview_00002.BMP", etc. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details).

Note: Requires that Acrobat as well as a specific preview creation plug-in that comes with the pdfImpositionLibrary Package is installed on the same machine. */ DECL_PREFIX IPL_int32_t IPL_PDFDocument_CreatePreviews( const IPL_Path_t* pdffile , const IPL_Path_t* previewfolder , IPL_TCREATEPREVIEW* lpcrpreview); /*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/ /*! \brief Same as PDFOutputStream_Open, but in addition it is indicated where pdfImpositionLibrary DLL shall store temporary files. \param lpsheetfile character pointer to the complete file path for the new sheet file \param file INPUT: pointer to an IPL_int32_t (see Output).
OUTPUT: filehandle for the created/opened sheet file; if an error occurs, the filehandle value will be -1.This filehandle is an internal ID and cannot be used outside the PDFengine Imposition Library DLL. \param tmpfpath path to store all temporary files into. If this parameter is NULL, then the platform default path was used. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.2 */ DECL_PREFIX IPL_int32_t IPL_PDFOutputStream_Open( const IPL_Path_t* lpsheetfile , IPL_sheetid_t* file , const IPL_Path_t* tmpfpath); /*-----------------------------------------------------------------------------*/ /*! \brief Saves and closes a sheet file. \param file Filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param save if this is true, then the sheet file was saved before close. This is useful, if an error occurs in process before. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.9 */ DECL_PREFIX IPL_int32_t IPL_PDFOutputStream_Close( IPL_sheetid_t file , IPL_bool_t withsave); /*-----------------------------------------------------------------------------*/ /*! \brief Inserts a sheet into an open sheet file. \param file Filehandle for an open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx INPUT: pointer to an IPL_int32_t (see Output)).
OUTPUT: The sheet number (or page number) starting with 'one'. In the case that the functions fails, the value will be -1. \param mediabox pointer to a IPL_TDRECT structure. Must indicate the lower left and the upper right corner for the PDF page's MediaBox of the new sheet (see PDF Reference Manual for a discussion of MediaBox). \param cropbox pointer to a IPL_TDRECT structure. Must indicate the lower left and the upper right corner for the PDF page's CropBox of the new sheet (see PDF Reference Manual for a discussion of MediaBox). \param trimbox pointer to a IPL_TDRECT structure. Must indicate the lower left and the upper right corner for the PDF page's TrimBox of the new sheet (see PDF Reference Manual for a discussion of MediaBox). \param bleedbox pointer to a IPL_TDRECT structure. Must indicate the lower left and the upper right corner for the PDF page's BleedBox of the new sheet (see PDF Reference Manual for a discussion of MediaBox). \param artbox pointer to a IPL_TDRECT structure. Must indicate the lower left and the upper right corner for the PDF page's ArtBox of the new sheet (see PDF Reference Manual for a discussion of MediaBox). \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.18 */ DECL_PREFIX IPL_int32_t IPL_PDFOutputStream_AddSheet( IPL_sheetid_t file , IPL_int32_t* sheetidx , IPL_TDRECT* mediabox , IPL_TDRECT* cropbox , IPL_TDRECT* trimbox , IPL_TDRECT* bleedbox , IPL_TDRECT* artbox); /*-----------------------------------------------------------------------------*/ /*! \brief Removes a sheet from an open sheet file. \param file filehandle for an open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number (or page number) of the sheet to be removed from the sheet file (starting with 'one)'. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ DECL_PREFIX IPL_int32_t IPL_PDFOutputStream_RemoveSheet( IPL_sheetid_t file , IPL_int32_t sheetidx); /*-----------------------------------------------------------------------------*/ /*! \brief Adds the so called "Document Info" to an open sheet file \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param lpinfo Pointer to IPL_PDFIMPOSITIONINFO structure. \param IPL_PDFIMPOSITIONINFO.size Contains size of this structure \param IPL_PDFIMPOSITIONINFO.lpAuthor this is the autor of the pdf file. \param IPL_PDFIMPOSITIONINFO.lpProducer the name of the application that created the document \param IPL_PDFIMPOSITIONINFO.lpTitle the document's title \param IPL_PDFIMPOSITIONINFO.lpSubject the subject of the document \param IPL_PDFIMPOSITIONINFO.lpKeywords keywords associated with the document \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.6 */ DECL_PREFIX IPL_int32_t IPL_PDFOutputStream_AddInfo( IPL_sheetid_t file , IPL_PDFIMPOSITIONINFO* lpinfo); /*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/ /*! \brief Same as IPL_PDFSheet_AddObject2. This function will call IPL_PDFSheet_AddObject2( ..., NULL); \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param objid pointer to an IPL_TOBJECTID structure \param IPL_TOBJECTID.size size of structure in bytes; sizeof(IPL_TOBJECTID) \param IPL_TOBJECTID.pdffile complete file path to the PDF file that contains the object to be positioned \param IPL_TOBJECTID.pageidx page number (starting with 'one') of the page that shall be positioned as an object onto the sheet \param IPL_TOBJECTID.userID INPUT: ID string provided by the user of the DLL; may be empty \param IPL_TOBJECTID.callasID OUTPUT: ID string created by the DLL \param matrix pointer to a IPL_TDMATRIX structure; transformation matrix - specifying position, scale, rotation etc. - for the object to be positioned onto the sheet \param clipbox pointer to a IPL_TDRECT structure; additional clipping rectangle for the object to be positioned onto the sheet; helps avoid unwanted overlap between objects \param demokey pointer to an optional string; if pointer is not NULL the string will bes used randmoly for the object positioned onto the page as a watermark; limits the usefulnes of the created sheet for actual production use \param colormapper pointer to a IPL_TCOLORMAPPER structure. If this parameter is NULL, no colormapping was performed. \param IPL_TCOLORMAPPER.size contains size of this structur \param IPL_TCOLORMAPPER.colors the number of colors entrys (pointers) in the oldcolor or newcolor pointer array. \param IPL_TCOLORMAPPER.oldcolor pointer of an char* array: holds the names of the old color names to be mapped. \param IPL_TCOLORMAPPER.newcolor pointer of an char* array: holds the names of the new color names to mapped to. \param IPL_TCOLORMAPPER.altpdf contains a alternate pdf file path, from with the colorspace can be imported. \param IPL_TCOLORMAPPER.altpagenum contains the page number, from with the colorspace can be imported, if altpdf different NULL. \param objcode contains pdf content stream code to insert before and/or after the new sheet object will be draw. \param objcode.size contains size of this structur \param objcode.preobjcode contains pdf contents stream code to insert straightly before sheet object will paint \param objcode.preobjcodelen contains the length in bytes of preobjcode \param objcode.postobjcode contains pdf contents stream code to insert straightly after sheet object will paint \param objcode.postobjcodelen contains the length in bytes of postobjcode \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.15 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_AddObject( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_TOBJECTID* objid , IPL_TDMATRIX* matrix , IPL_TDRECT* clipbox , const IPL_utf8_char_t* demokey , IPL_TCOLORMAPPER* colormapper , IPL_TPDFOBJECTCODE* objcode); /*-----------------------------------------------------------------------------*/ /*! \brief Add a enw sheet object. But function allow to set transparency group properties. \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param objid pointer to an IPL_TOBJECTID structure \param IPL_TOBJECTID.size size of structure in bytes; sizeof(IPL_TOBJECTID) \param IPL_TOBJECTID.pdffile complete file path to the PDF file that contains the object to be positioned \param IPL_TOBJECTID.pageidx page number (starting with 'one') of the page that shall be positioned as an object onto the sheet \param IPL_TOBJECTID.userID INPUT: ID string provided by the user of the DLL; may be empty \param IPL_TOBJECTID.callasID OUTPUT: ID string created by the DLL \param matrix pointer to a IPL_TDMATRIX structure; transformation matrix - specifying position, scale, rotation etc. - for the object to be positioned onto the sheet \param clipbox pointer to a IPL_TDRECT structure; additional clipping rectangle for the object to be positioned onto the sheet; helps avoid unwanted overlap between objects \param demokey pointer to an optional string; if pointer is not NULL the string will bes used randmoly for the object positioned onto the page as a watermark; limits the usefulnes of the created sheet for actual production use \param colormapper pointer to a IPL_TCOLORMAPPER structure. If this parameter is NULL, no colormapping was performed. \param IPL_TCOLORMAPPER.size contains size of this structur \param IPL_TCOLORMAPPER.colors the number of colors entrys (pointers) in the oldcolor or newcolor pointer array. \param IPL_TCOLORMAPPER.oldcolor pointer of an char* array: holds the names of the old color names to be mapped. \param IPL_TCOLORMAPPER.newcolor pointer of an char* array: holds the names of the new color names to mapped to. \param IPL_TCOLORMAPPER.altpdf contains a alternate pdf file path, from with the colorspace can be imported. \param IPL_TCOLORMAPPER.altpagenum contains the page number, from with the colorspace can be imported, if altpdf different NULL. \param objcode contains pdf content stream code to insert before and/or after the new sheet object will be draw. \param objcode.size contains size of this structur \param objcode.preobjcode contains pdf contents stream code to insert straightly before sheet object will paint \param objcode.preobjcodelen contains the length in bytes of preobjcode \param objcode.postobjcode contains pdf contents stream code to insert straightly after sheet object will paint \param objcode.postobjcodelen contains the length in bytes of postobjcode \param trgroup defines the behaviour of transparency group information from original page, if NULL transparency group will always copied and I(solated) will set to true. \param trgroup.size contains size of this structur \param trgroup.isolated transparency group action to set I(solated) value or ignore all transparency group settings. \param trgroup.blendmode a BlendMode to set a blending effect to whole pdf object \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 2.05 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_AddObject2( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_TOBJECTID* objid , IPL_TDMATRIX* matrix , IPL_TDRECT* clipbox , const IPL_utf8_char_t* demokey , IPL_TCOLORMAPPER* colormapper , IPL_TPDFOBJECTCODE* objcode , IPL_TTRANSPGROUP* trgroup); /*-----------------------------------------------------------------------------*/ /*! \brief Removes an object previously positioned onto a sheet \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param objid pointer to a IPL_TOBJECTID structure \param IPL_TOBJECTID.size size of the structure in bytes; sizeof(IPL_TOBJECTID) \param IPL_TOBJECTID.callasID ID string as previously proived by the DLL; if this string is emty, userID will be used instead. \param IPL_TOBJECTID.userID ID string as previously provided by the user of the DLL; will only be used if callasID is empty.. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_RemoveObject( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_TOBJECTID* objid); /*-----------------------------------------------------------------------------*/ /*! \brief Retransforms - i.e. applies a different transformation matrix or clipping rectnangle - an object already positioned onto a sheet \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param objid pointer to a IPL_TOBJECTID structure \param IPL_TOBJECTID.size; size of the structure in bytes; sizeof(IPL_TOBJECTID) \param IPL_TOBJECTID.callasID ID string as previously proived by the DLL; if this string is emty, userID will be used instead. \param IPL_TOBJECTID.userID ID string as previously provided by the user of the DLL; will only be used if callasID is empty.. \param matrix pointer to a IPL_TDMATRIX structure; new transformation matrix \param clipping pointer to a IPL_TRECTIFYCLIPRECT structure. If this parameter is NULL, no clipping path feature was performed. \param IPL_TRECTIFYCLIPRECT.size contains size of this structur \param IPL_TRECTIFYCLIPRECT.searchbox Contains the box size to find in contents stream as clipping path and eliminate. Only used if unequal to NULL. \param IPL_TRECTIFYCLIPRECT.clipbox Contains the new clipping rectangle or differences, see absolute. Only used if unequal to NULL. \param IPL_TRECTIFYCLIPRECT.absolute If this is true, then clipbox contains the new absolute size else it contains only signed differences. \param clipathfound is a return value and show if the function has found the referenced clipping path in the contents stream to be erase. If clipping equal to NULL then the variable will ignored. \param objcode contains pdf content stream code to insert before and/or after the existing sheet object will be draw. NOTE If no pre- or post- object code needed it can be NULL \param objcode.size contains size of this structur \param objcode.preobjcode contains pdf contents stream code to insert straightly before sheet object will paint. NOTE: If this is NULL no changes will performed. To remove an existing per code put an empty string into objcode.preobjcode. \param objcode.preobjcodelen contains the length in bytes of preobjcode \param objcode.postobjcode contains pdf contents stream code to insert straightly after sheet object will paint NOTE: If this is NULL no changes will performed. To remove an existing post code put an empty string into objcode.postobjcode. \param objcode.postobjcodelen contains the length in bytes of postobjcode \return On success 0 (zero) will be returned, otherwise an error code will be returned. wird Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.15 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_RetransformObject( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_TOBJECTID* objid , IPL_TDMATRIX* matrix , IPL_TRECTIFYCLIPRECT* clipping , IPL_bool_t* clipathfound , IPL_TPDFOBJECTCODE* objcode); /*-----------------------------------------------------------------------------*/ /*! \brief Insert private PDF contents stream code into a sheet; this private PDF contents stream code will be handled as an object (i.e. it will also carry Ids and can be removed later on using IPL_PDFSheet_RemoveObject). Contrary to IPL_PDFSheet_InsertPDFCode here we can specify whether the CALS_Courier and or the CALS_ColorspaceAll resource will be put in the sheet file. \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param pdfcodeid pointer to a IPL_TPDFCODEID structure. \param IPL_TPDFCODEID.size size of structure in bytes; sizeof(IPL_TPDFCODEID) \param IPL_TPDFCODEID.pdfcode private PDF contents stream code of variable length that shall be positioned as an object onto the sheet \param IPL_TPDFCODEID.pdfcodelen length of string with private PDF contents stream code \param IPL_TPDFCODEID.allcolorspace If allcolorspace is not NULL, the default color space will be separation color "All" so that the private PDF cntents stream code (unless it switches to a different color space) will image on all plates when separated; a colorspace will be inserted into the page's resource dictinary \param IPL_TPDFCODEID.callasID OUTPUT: ID string created by the DLL \param IPL_TPDFCODEID.userID INPUT: ID string provided by the user of the DLL; may be empty \param pdfcodecolor pointer to a TPDFCODECOLOR structure. If this parameter is NULL, no own colorspace was installed. \param TPDFCODECOLOR.size size of structure in bytes; sizeof(TPDFCODECOLOR) \param TPDFCODECOLOR.colorname[MAX_PATH] the name of the separation or colorant. \param TPDFCODECOLOR.colorcomp the number of color components, 1, 3 and 4 are valid numbers. Dependent from this, the alternate colorspace was created. \param TPDFCODECOLOR.colorv[4] the color values for the alternate color, colorcomp says how many values are valid. \param extgrstate pointer to a IPL_TEXTGRSTATE structure. Specifies how the PDF code set a extended graphic state. If this parameter is NULL, no own extended graphic state was installed. \param IPL_TEXTGRSTATE.size size of this structur in bytes; sizeof( IPL_TEXTGRSTATE) \param IPL_TEXTGRSTATE.mask specifying which attributes to set, must be a combination of values from IPL_EExtGrState enum. \param IPL_TEXTGRSTATE.strokeadj stroke adjustment. \param IPL_TEXTGRSTATE.strokeoprintoverprint for stroke. \param IPL_TEXTGRSTATE.filloprintoverprint for fill. \param IPL_TEXTGRSTATE.oprintmode the overprint mode. \param IPL_TEXTGRSTATE.smoothness smoothness, \param IPL_TEXTGRSTATE.linewidth the line width. \param IPL_TEXTGRSTATE.linecap the line cap. \param IPL_TEXTGRSTATE.linejoin the line join. \param IPL_TEXTGRSTATE.miterlimit the miter limit. \param IPL_TEXTGRSTATE.flatness the flatness. \param pdfcodefont pointer to a IPL_TPDFCODEFONT structure. If this parameter is NULL, then the library use Courier. \param IPL_TPDFCODEFONT.size contains size of this structur; sizeof( IPL_TPDFCODEFONT) \param IPL_TPDFCODEFONT.fontsize contains the font size used in the pdf code. \param IPL_TPDFCODEFONT.name contains the basefont name used in the pdf code. \param IPL_TPDFCODEFONT.encoding contains the font encoding used in the pdf code. \param IPL_TPDFCODEFONT.cspacing is the additional displacement between two characters. \param IPL_TPDFCODEFONT.wspacing is the additional displacement between two words. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details).

Note: Using IPL_PDFSheet_RemoveObject it is possible to remove the inserted private PDF contents stream code again later on.

Note: This functions inserts the following PDF contents stream code snippets before and after the private PDF contents stream code: \code q /CALS_IPL_CALSId << /Creator (PDF-Imposition-Library; Draft-Version 1.0, Debug V1.0.005) /CreationDate (D:19991110083402+02'00') /ID (1414123) >> BDC /CALS_IPL_UserId << /ID (user id string) >> BDC [ /CALS_ColorspaceAll cs 1 sc /CALS_ColorspaceAll CS 1 SC ] or [ 1 1 1 1 k 1 1 1 1 K ] /CALS_Courier 7 Tf 0 Tc 0 Tw . . private PDF contents stream code goes here . EMC EMC Q \endcode */ /* new in interface version, 1.14 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_InsertPDFCode( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_TPDFCODEID* pdfcodeid , IPL_TPDFCODECOLOR_2* pdfcodecolor , IPL_TEXTGRSTATE* extgrstate , IPL_TPDFCODEFONT* pdfcodefont); /*-----------------------------------------------------------------------------*/ /*! \brief Inserts 'SeparationInfo' into a sheet file (see PDF Reference Manual for a detailed discussion of the SeparationInfo dictionary) \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sepinfo pointer to a IPL_TSEPARATIONINFO structure \param IPL_TSEPARATIONINFO.size size of this structure \param IPL_TSEPARATIONINFO.pagenum numbers of sheets (pages) for this separation info, implies the size for the arrays below. \param IPL_TSEPARATIONINFO.isname pointer of an bool array: is true, if colorname specified a name object not a string, like "(Cyan)" versus "/Cyan". \param IPL_TSEPARATIONINFO.colorname pointer to a char* array: the name of the device colorant assigned to this separation. \param IPL_TSEPARATIONINFO.pagearray pointer to a long array: an array of page numbers which are the PDF pages (plates) that comprise a single logical document page. \param IPL_TSEPARATIONINFO.logpagenum contains the logical page number, necessary for pagelabel dict. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details).

*/ /* new in interface version, 1.3 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_InsertSepInfo( IPL_sheetid_t file , IPL_TSEPARATIONINFO* sepinfo); /*-----------------------------------------------------------------------------*/ /*! \brief This function enumerate all available objects from an open sheet. returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param fct Pointer to the callback function must be of type IPL_EnumObjectCB. \param data void poitner that will be input in the data parameter of the callback function whenever it is called. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.11 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_EnumObjects( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_EnumObjectCB fct , void* data); /*-----------------------------------------------------------------------------*/ /*! \brief This function can export an existing sheet object from an open sheet. \param file filehandle for the open sheet file. Must be a value that has been returned by PDFOutputStream_Open or PDFOutputStream_Open2. \param sheetidx the sheet number(or page number), starting with 'one', onto which the object shall be positioned \param objid pointer to an IPL_TOBJECTID structure \param IPL_TOBJECTID.size size of structure in bytes; sizeof(IPL_TOBJECTID) \param IPL_TOBJECTID.pdffile complete file path to the PDF into the sheet object should be exported \param IPL_TOBJECTID.pageidx page number (starting with 'one') of the export page. After process in this variable is the real page number (starting with 'one'). \param IPL_TOBJECTID.userID user ID string from the sheet object, either userID must be defined or callasID or both. \param IPL_TOBJECTID.callasID callas ID string from the sheet object, either userID must be defined or callasID or both. \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.11 */ DECL_PREFIX IPL_int32_t IPL_PDFSheet_ExportObject( IPL_sheetid_t file , IPL_int32_t sheetidx , IPL_TOBJECTID* objid); /*-----------------------------------------------------------------------------*/ /*! Imposes a pdf document. Pages from a pdffile are imposed to sheets taken from a template file. The definition for each imposed page is stored in a slot, a IPL_TIMPOSITIONSLOT structure. The sheets referenced in the slot are taken from a template document. As first action \a numSheetPages sheets are added to the imposedFile. The sheets are taken from the file \a templateFile. For each sheet to be added the page number in the templateFile is stored in the array \a sheetPages. For each slot following tasks are performed: - create XObject from page sourcePageNum of source document - place XObject on sheet \a templateSheetNum with transformation matrix \a transformation and clipping rect \a clippingRect. The imposed file is saved with path imposedfile. If the imposedfile is equal to the pdffile the source file is overwritten. \param pdfFile file to impose \param imposedFile imposed file. If equal to pdffile the imposed pages will be append to the pdffile and the original pages are deleted \param templateFile template file containing sheets \param numSheetPages number of sheets to be added to imposedfile (size of array sheetPages) \param sheetPages sequence of template pages from templatefile to be added as sheets to imposedfile \param numSlots number of slots in slot array (size of array slots) \param slots slot array \param slots.size contains size of this structure \param slots.sourcePageNum page number from source document \param slots.templateSheetNum sheet number for imposed page \param slots.clipType shows what box should be used for clipping \param slots.clippingRect clipping rect for slot in sheet coordinates (used if cliptype == eUseExternal) \param slots.transformation transformation matrix for page position, transforms the page mediabox to the sheets (template page) destination rect \param slots.callasID object ID string, use from callas to identify objects into sheet \param slots.userID object ID string, use from other dll user to identify objects into sheet \param demokey pointer to an optional string; if pointer is not NULL the string will bes used randmoly for the object positioned onto the page as a watermark; limits the usefulnes of the created sheet for actual production use \return On success 0 (zero) will be returned, otherwise an error code will be returned. Using the function IPL_GetErrorStringFromErrorCode it is possible to retrieve a human readable error text (see description of IPL_GetErrorStringFromErrorCode for further details). */ /* new in interface version, 1.12 */ DECL_PREFIX IPL_int32_t IPL_PDFDocument_ImposeFromFile( const IPL_Path_t* pdfFile , const IPL_Path_t* imposedFile , const IPL_Path_t* templateFile , IPL_int32_t numSheetPages , IPL_int32_t* sheetPages , IPL_int32_t numSlots , IPL_TIMPOSITIONSLOT* slots , const IPL_utf8_char_t* demokey); /*-----------------------------------------------------------------------------*/ #undef DECL_PREFIX #if defined(MAC_PLATFORM) && defined(__MWERKS__) # pragma export off #endif #if defined(__cplusplus) } /*extern "C"*/ #endif /*defined(__cplusplus)*/ #endif /* _PDFIMPOSITIONLIB_H */ /*-----------------------------------------------------------------------------*/ /*! \history ** AD-2002-12-04: insert history ** AD-2002-12-04: insert interface extension for version 1.12 ** AD-2002-12-12: The interface 1.12 functions should have a optional demo char string. ** MF-2003-04-01: export symbols with #pragma export - macro instead of '.exp' file. ** AD-2003-07-25: PDFDocument_ListContents3 with report format parameter ** DO-2003-08-20: DECL_PREFIX defined for unix ** Ufr-2003-09-05: added PDFSheet_InsertPDFCode5 ** Ufr-2003-09-05: interface version set version 1.14 ** ADi-2003-09-11: change some comments ** ADi-2004-03-08: callas header are obsolete ** ADi-2005-01-13: enum EResourceHandling is obsolete now, use eCustomFont as font name instead ** ADi-2005-06-30: Version 1.15: new function PDFSheet_RetransformObject3 and PDFSheet_AddObject3 added to support user defined clipping ** ADi-2005-11-28: actualize the library version number ** ADi-2007-03-29: rename header and rename struct PDFIMPOSITIONINFO and define error code in enum EImpLib_ErrorCodes ** ADi-2008-05-09: add new function PDFOutputStream_AddSheet2(..) ** ADi-2008-11-21: rearrange pdfImposition library interface to version 2.0 ** ADi-2009-02-03: correct comments ** ADi-2009-03-02: BUG CaBT 0001565: fit to use in pdfToolbox4 SDK library ** ADi-2009-05-27: CaBT 0001029: add function IPL_PDFSheet_InsertTextAPDFL(..) and IPL_EnumSystemFontsAPDFL(..) increment library version ** ADi-2009-11-18: CaBT 0003718: add new function IPL_PDFDocument_EnumPageProperties and types to support quick page information ** UFr-2009-12-15: CaBT 0004026: Allow specification of tintvalue for spot colors while rendering text ** RGu-2010-02-10: removed _WINDLL because Imposition is part of a static library ** HTh-2010-08-11: CaBT 0004720: 64 bit support (MS-Windows preparations) ** ADi-2010-10-15: actualize version V2.3.109 ** UFr-2011-08-31: Added new interface 'IPL_GetTextWidthAPDFL', Incremented interface version to 2.4 ** ADi-2012-08-13: CaBT 0007876: add enum IPL_ETrGroupAction and struct IPL_TTRANSPGROUP and function IPL_PDFSheet_AddObject2(.. ) in V2.05 ** ADi-2017-01-27: CaBT 0012908: increment verion number amd extend function IPL_PDFSheet_AddObject2(..) */