I have a problem with PXC_GetPage, application crashed when using with existing document.
Problem:
I have a problem with PXC_GetPage application crashing when using with existing document.
I want to extract a page from an existing document and change the scale of the page. The application crashed on the PXC_GetPage function (which is Ok if I used a variable created with PXC_NewDocument)
res : HRESULT;
page: PXCPage;
pcnt : dword ;
newdoc : HPDF ;
begin
if FormMainMenu.hDocument <> 0 then
res := PXC_GetPage(FormMainMenu.hDocument, 0, @page) ; => Crashed
res := PXC_CS_Scale(page, 0.5, 0.5); // change the scale
Resolution:
This is expected behavior - because all of our DLL's do not allow "mixed" usage: all handles (documents, pages, etc) can be operable only within the same library from which you get them. So a document handle, created using xcpro40.dll, cannot be used in functions from pxclib40.dll and vice versa. It is the same for pxcview.dll. There is only one exception, Image-XChange, page handles can be used in functions from another DLL, where it is declared.
If you need to add some content to existing page you should create new document with this content, save it to disk, read using xcpro40.dll and place over existing using PXCp_PlaceContents.
If you need to place contents on several pages, it is recommended that you do this all at once - this will be faster and the resulting file will be smaller.
More Like This
-
KB#72: How do Icopy an image from an existing PDF file to a new PDF file and retain the original dimensions?
-
KB#227: I have an issue using the PDF-XChange SDK sample code with Microsoft Visual Basic in 'Interactive Mode' for debugging.
-
KB#50: Error when running application scheduled task
-
KB#51: I have a problem with my web application making calls to PXCLIB40.dll when running in 64 bit development environment
-
KB#118: Can I use the PDF-XChange print driver from Delphi 5 to save a Quick Report as a PDF file without user intervention?