Knowledgebase

Back to Articles List

Is it possible to combine functions from the PXCLIB40 and XCPRO40 libraries?

Question:

Is it possible to combine functions from the PXCLIB40 and XCPRO40 libraries?

For example, to open an existing document and then add an image to it, could the following sequence be used:

PXCp_Init

PXCp_ReadDocumentW 

PXC_InsertPage

PXC_AddImageFromHBITMAP

PXC_PlaceImage

PXCp_WriteDocumentW

Answer:

Currently it is not possible to combine the functions of the PXCLIB40 and XCPRO40 libraries. This is because PXCLIB40 does not contain functionality to operate with existing documents. The best method to add content to pages of existing documents is as follows:

  1. Use XCPRO40 to gather information from an existing file.
  2. Use PXCLIB40 to create a new document that contains the required content, and then save it to a temporary file.
  3. Use XCPRO40 to open the temporary file.
  4. Use PXCp_InsertPagesTo (to insert pages) or PXCp_PlaceContents (to place content from one page into another page) in order to combine elements of the temporary file with an existing file
  5. Save the modified document, the close it and delete the temporary file.
Was this article helpful?
Yes No Somewhat