PXC_GetPage - Crashed when using with existing document

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
grousseau
User
Posts: 1
Joined: Mon Oct 27, 2008 10:10 am

PXC_GetPage - Crashed when using with existing document

Post by grousseau »

Hello,

I want extract a page from an existing document (test based on DelphiPXProSample) for change the scalle of a page. The application crashed on the PXC_GetPage function (ok if i ised a variable created with PXC_NewDocument.
An idea ?

var
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
User avatar
Lzcat - Tracker Supp
Site Admin
Posts: 677
Joined: Thu Jun 28, 2007 8:42 am

Re: PXC_GetPage - Crashed when using with existing document

Post by Lzcat - Tracker Supp »

This is expected behavior - becuse all our dll's do not allow "mixed" usage: all handles (documents, pages, etc) can be operable only with same library from which you get them, so document handle created using xcpro40.dll cannot be used in functions from pxclib40.dll and vice versa. Same for pxcview.dll. There is only one exclusion - Image-XChange pages handles can be used in functions from another dll, where this 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 and place over existing using PXCp_PlaceContents.

If you need to place contents on several pages it is recommended to do this at once - this will be faster and resulting file will be smaller.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Post Reply