OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

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
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Hi,

We want to create an OLE custom control with PDF_Xchange Editor ActiveX Control in a PowerBuilder 12.5 legacy application.

We downloaded the latest version of the Editor SDK and are using PDFXEditCOre.x86.dll

We are aware than Powerbuider is an older tool/langage that has more in common with Visual Basic 6.0. than C#. The sample app included with the SDK is great but unfortunately, is not as helpful as expected for us.

We succeeded to use OpenDocWithDlg . The app shows the file dialog as expected and the selected .pdf document is displayed in the PowerBuilder form.

Code: Select all

uo_pdf_annot.ole_pdf_editor.Object.OpenDocWithDlg()
But we failed to use OpenDocFromPath. This command does not work even if the path/document passed in parameter is available. An unhandled error is returned so we don't have a clue of what's wrong.

Code: Select all

uo_pdf_annot.ole_pdf_editor.Object.OpenDocFromPath('C:\Temp\P000086500001305092.pdf')
Same result with OpenDocFrom.

Do you have an idea why OpenDocWithDlg would work but not OpenDocFromPath ?

Thank you,

Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Sasha - Tracker Dev Team »

Hello Eric,

Can you please give us a sample project that we can look into and debug the problem?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Hello Alex,

It's in PowerBuilder. Are you OK with this?

Thanks!

Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Sasha - Tracker Dev Team »

Hello Eric,

Well, we do not know this API yet, though we'll need the sample to see the problem. So yes, please provide it if you can.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Hi Alex,

We have a .ZIP with all the file you will need for a sample that doesn't require a complete Power Builder install.

How can I sen it to you?

Cheers,

Eric
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Tracker Supp-Stefan »

Hello Eric,

Alex has finished for the day, so allow me to answer.
If you can upload the file somewhere, please do and then post the link here, or if the whole zip is less than 20 MB - you can also try e-mailing it to support@pdf-xchange.com with a link back to this topic and we will pass it along to Alex to look at.

Regards,
Stefan
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Hello Stefan,

You will find the file here : https://drive.google.com/open?id=0B_51V ... 3lHVlRIYXM

Please have a look at the readme.pdf file for explanations.

All the best,

Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Sasha - Tracker Dev Team »

Hello Eric,

We've successfully launched your sample. From what we suspect, there is a problem with strings or with the default parameters. Please try using this method https://sdkhelp.pdf-xchange.com/vie ... l_ShowPane

Code: Select all

uo_pdf_annot.ole_pdf_editor.Object.ShowPane('stampsView', true, false)
If it launches successfully then the problem is with the default parameters.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Thank you Alex,

uo_pdf_annot.ole_pdf_editor.Object.ShowPane('stampsView', true, false) works!

So we suspected that the "\" may have to be escaped.

We tried several combinations to get a string parameter that result in " C:\Temp\abc.pdf"

Everytime we pass the resulting string to ole_pdfXchange_editor_control.Object.OpenDocFromPath, with or without specifying the optional parameters, it fails.

Any idea?

Thanks!

Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Sasha - Tracker Dev Team »

Hello Eric,

Try using this:
https://sdkhelp.pdf-xchange.com/vie ... nDocParams
And pass it as a second argument of the OpenDocFromPath method.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Thank you Alex,

Could it be possible for you to give us an example? Something in VB6 would be great and closer to PowerBuilder than C#.

Cheers,

Eiic
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Sasha - Tracker Dev Team »

Hello Eric,

Here's the sample project:
AppSimpleOpenPDF.v1.zip
(54.96 KiB) Downloaded 82 times
By the way, we've remembered that the VB6 does not support this method with the default parameters. Probably that's where the problem lies - so basically you should use it as it is shown in the provided sample.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

Thank you very much Alex.

It's very appreciated and will definitely be useful!

Cheers,

Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Erickc
User
Posts: 46
Joined: Tue Apr 12, 2016 2:36 pm

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Erickc »

For info and if it may helps someone in the future, here is what made "OpenDocFromPath" work

Code: Select all

OLEObject myIcab
myIcab = ole_pdfXchange_editor_control.Object.Inst.CreateOpenDocParams()
ole_pdfXchange_editor_control.Object.OpenDocFromPath( 'C:\Temp\abc.pdf' , myIcab)
Thank you again Tracker support team! :D
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: OpenDocWithDlg works but OpenDocFromPath fail in PowerBuilder

Post by Tracker Supp-Stefan »

Hi Eric,

Glad to hear all is now working properly for you!

Cheers,
Stefan
Post Reply