PowerBuilder and PDF-XChange Editor SDK

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

PowerBuilder and PDF-XChange Editor SDK

Post by greg.rusak@mustimuhw.solutions »

Here’s the background information.

1. We downloaded and installed the PDF-XChange Editor SDK product.
2. Copied PDFXEditCore.x86.dll and Resource.dat to C:\Windows\System32
3. Registered the COM dll with regsrv32.
4. As you can see from the following, the product is registered and available as a COM ActiveX Object in PowerBuilder
class_information.png
5. We drop the OLE control onto our form:
control_on_form.png
6. In the post open event of this form, we have the following code snippet, as an example:
IF gnv_app.of_write_blob_to_file(this.is_temp_file, this.iblb_pdf) > 0 THEN
li_return = ole_tracker_pdf.Activate(OffSite! )
Sleep(1)
ls_key = ''
lb_result = ole_tracker_pdf.Object.SetLicKey(ls_key)
ole_tracker_pdf.object.OpenDocFromPath(this.is_temp_file, lole_object)
lole_inst = ole_tracker_pdf.object.inst
lole_inst.Init()
lole_test = lole_inst.GetExtension("PXC")
lole_doc = ole_tracker_pdf.object.doc
SetPointer(Hourglass!)
ole_tracker_pdf.Object.PrintWithDlg(TRUE, FALSE)

RETURN
END IF
7. In the above code, we activate the OLE Control on our form, call SetLicKey (with an empty string) then we open a PDF document from the file system and then get a handle to Inst and Doc and finally as a test we open the Print Dialog box.
8. Now when we run our code and the form is rendered, we get an “empty” OLE Control that does NOT display the PDF that was opened, but in the Print Dialog Window, it is clear that the PDF is there as a Preview.
9. See attachment. Notice the empty form in the background but the preview shows the PDF form?
print.png
Is there is something obvious we’re missing here that you can help with, that would be truly appreciated.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PowerBuilder and PDF-XChange Editor SDK

Post by Sasha - Tracker Dev Team »

Hello greg.rusak@mustimuhw.solutions,

For starters, you don't need to call the IPXV_Inst::Init method while using the IPXV_Control (unless you created it manually before the control initialization):
https://sdkhelp.pdf-xchange.com/view/PXV:CoClasses
Also, have you tried opening different types of files (not just form based)? For example, this one:
https://www.tesla.com/sites/default/fil ... odel-s.pdf

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: PowerBuilder and PDF-XChange Editor SDK

Post by greg.rusak@mustimuhw.solutions »

Thanks Alex,

It appears that when the OLE control was painted on the form, the incorrect "type" was dropped. It is now rendering. Thanks for that. Will now be looking at help with getting the number of form fields in a XFA form and getting/setting values from text fields, checkboxes, etc. Will post that separately. Thanks.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PowerBuilder and PDF-XChange Editor SDK

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply