Back to Articles List

I have a problem with PXC_DrawTextExW.


I am having a problem with PXC_DrawTextExW.

When I try to draw some portion of text into a merged PDF file, which is initiated via
PXCp_init(out PDFid)
then call PXCp_llGetPageByIndex(PDFid, pageToPlace, out pageID);
then call PXC_DrawTextExW(pageID, ref rect, text, 0, text.Length, 0, ref opts);
I receive an error.


This is correct behavior. Why? Because you are mixing function from different pdf SDKs.

The rule is simple: functions begin with PXCp_*, PXP_* and PXCV_* representing different pdf SDK's (pdf modification, pdf creation and simple pdf rendering corresponding), and any object created using functions from one of the SDK's cannot be used in the other two. If you need to add some content on existing PDF you may do it in one of two ways:

1. Use xcpro40 Low-Level API only (requires a lot of work, but allows almost everything that is allowed by the Adobe PDF Reference Specification).

2. Create new document with additional content using pxclib40, save it to disk (in temporary file) and then combine with existing pdf using PXCp_PlaceContents function (see PDFTools4SDK.pdf help file pg. 265, Topic:  PXCp_PlaceContents)

Was this article helpful?
Yes No Somewhat