1. Gregory Rusak
  2. PowerBuilder
  3. Saturday, 17 November 2018 18:55 PM UTC

Hello,

Does anyone have any experience using Foxit's PDF SDK for Windows (either C++, .NET or Java API) in a PowerBuilder win32 Classic application? (https://developers.foxitsoftware.com/sdk-docs/)

We're currently using their ActiveX Control in our PB 2017 R2 application, which is somewhat limited in functionality for Acro Forms and such and it also appears Foxit is no longer making any improvements to it.

If anyone has feedback or ideas on direction, that would be appreciated.

Kind Regards,

Greg

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 20 November 2018 15:25 PM UTC
  2. PowerBuilder
  3. # 1

Hi Greg;

  Other things to consider when calling Foxit's C++ Dll ...

  • Since the arguments to the Initialize() method are by REF - make sure that you initialize them fully. For example ... ls_key = Space (255)
  • You may also have to contend with byte alignment by adding a Progma_Pack statement on your external declaration.

FYI: 

FUNCTION ulong Initialize (REF char sn[], REF char key[]) library "fsdk_win32.dll" progma_pack(1)

Note: progma_pack(1) is 1-byte align, progma_pack(8) is 8-bytes align. In this way, the effect is only for external function that is declared with this alignment.

  • The other thing to try is to add a TRY..CATCH around your SDK call and then check the exception object for more information as why the external function call failed.

Hopefully, Foxit have provided more details in their internal documentation.

Regards ... Chris

Comment
There are no comments made yet.
Gregory Rusak Accepted Answer Pending Moderation
  1. Monday, 19 November 2018 21:29 PM UTC
  2. PowerBuilder
  3. # 2

Hey Chris,

So as a quick test using Foxit's C++ .dll (fsdk_win32.dll), I thought I'd at least try the following since their documentation (attached image) states "It is necessary for apps to initialize Foxit PDF SDK
using a license before calling any APIs."

  1. Copied the .dll to C:\Windows\System32 folder to make sure it was seen in the path.
  2. Declared a Local External Function:
    1. FUNCTION ulong Initialize (REF char sn[], REF char key[]) library "fsdk_win32.dll"
  3. Then tried to call it, but got the:
    1. Error calling external function Initialize at line 10 in function of_initialize of object w_main.
  4. According to their documentation, and Dll Export Viewer (see attached) sn and key are both char pointers, so I tried char sn[] and char key[]. As well as trying straight strings with the same result.

From DLL Export Viewer, it appears the function is declared as public, so i'm not sure why the error.

Any ideas, Chris or anyone else having experience with Foxit C++ dll or any other C++ dll used in a PowerBuilder win32 application?

Thanks

 

Greg

 

Attachments (2)
Comment
  1. Brad Mettee
  2. Tuesday, 20 November 2018 13:48 PM UTC
Declaration should be:

FUNCTION ulong Initialize (REF char sn, REF char key) library "fsdk_win32.dll"

or (if they don't do unicode):

FUNCTION ulong Initialize (REF char sn, REF char key) library "fsdk_win32.dll" alias for "Initialize;ANSI"

  1. Helpful
  1. Gregory Rusak
  2. Tuesday, 20 November 2018 18:32 PM UTC
Thanks. Tried every combination/permutation with your feedback as well as Chris' and still no luck. No extra information provided in the CATCH. Have reached out to Foxit, but not expecting much in the way of a return. If any other thoughts or ideas, appreciated.
  1. Helpful
  1. Gregory Rusak
  2. Tuesday, 20 November 2018 18:34 PM UTC
BTW, they also have a Java SDK API, but I'm guessing I'll run into issues with complex datatypes and would have to write wrappers for many methods as well. They offer as well a .NET flavor, but I also don't see a way of getting a visual assembly rendered in a PowerBuilder win32 application. Ideas or direction as always, appreciated.

Greg
  1. Helpful
There are no comments made yet.
Gregory Rusak Accepted Answer Pending Moderation
  1. Sunday, 18 November 2018 21:50 PM UTC
  2. PowerBuilder
  3. # 3

Yes Chris, it is a C++ dll. I'll check their API, but I don't immediately see a method exposed that takes a Windows Handle and renders their PDF control on it.

And Yes, I'm hoping some other members in the community can chime in with some experience rendering "any" visual object from a C++ dll (doesn't have to be Foxit albeit that would be nice).

Thanks for your help. If you do happen to come across any code snippets from your past experiences, that would be appreciated.

Regards,

Greg

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 18 November 2018 22:08 PM UTC
I'll go back over my archived code tonight & post back tomorrow if I find anything along this line.
  1. Helpful
There are no comments made yet.
Gregory Rusak Accepted Answer Pending Moderation
  1. Sunday, 18 November 2018 04:39 AM UTC
  2. PowerBuilder
  3. # 4

Hey Chris,

Got any working example of this? How do you give it a windows handle? via an "external visual"? I tried something like that, but wasn't able to get a control visible on the window? If you have an example of any 3rd party C++ dll giving it a windows handle and then using that area to paint the appropriate image or PDF, that would be truly appreciated.

I really must be missing something simple here.

Thanks again.

Greg

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 18 November 2018 16:00 PM UTC
Unfortunately, this was a few years ago when I was working as an independent consultant and not for Appeon.

The Window handle is easy to get using PB's built-in Handle() method.
  1. Helpful
There are no comments made yet.
Gregory Rusak Accepted Answer Pending Moderation
  1. Sunday, 18 November 2018 02:03 AM UTC
  2. PowerBuilder
  3. # 5

Thanks for that Chris.

So when you say "supplied as a dll", can you explain what you had to do to render their PDF control on a Window? Was their .dll C++, .NET, or other? Did it have a "visual component" or was it "COM Callable" so you could register it is a COM object and drop on a Window? Or was it just a .dll that you could "create" a visual user object from?

That's what I'm struggling with? I can't see a way of visually presenting a C++ .dll or a .Net .dll in a win32 application. So I must be missing something if that can be done.

Any help with this is again appreciated.

Warm Regards,

Greg

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 18 November 2018 04:20 AM UTC
This is a C++ DLL. You just give it a Window handle & it uses that area to paint the appropriate image or PDF.
  1. Helpful
There are no comments made yet.
Gregory Rusak Accepted Answer Pending Moderation
  1. Saturday, 17 November 2018 22:00 PM UTC
  2. PowerBuilder
  3. # 6

Hi Chris,

Thanks for he quick response.

We've had great success with Foxit's ActiveX control, but it does have a number of limitations that will not be addressed with product maintenance. However, their C++ and .Net API has all the functionality that we could ever need - it's just that I don't see a visual component to their C++ and .NET SDK that could be leveraged in a PB win32 app - unless I'm missing something.

The ActiveX OleObject was simple to paint on a Window to expose all the methods of the OLE control, but I don't see any way of doing this with their C++, .NET or Java API SDK. Do you know if it's possible to render a visual control from those API's .dll's?

I don't have any experience with any of those other vendor's products? Are they all ActiveX controls you know or other?

Kind Regards,

Greg

 

 

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 18 November 2018 00:57 AM UTC
Yes, I've used ImageGear before that does render images & PDF's visually. It's only supplied as a DLL. I've never used Foxit, so I can't give you any real comparisons. I have also used the Adobe SDK as well.

Hopefully, one of the other community members will chime in with some actual Foxit experience advice.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 17 November 2018 21:43 PM UTC
  2. PowerBuilder
  3. # 7

Hi Greg;

      You can develop Acroforms using a number of different PDF platforms, such as Foxit PhantomPDF, Adobe Acrobat, Nitro Pro, Nuance Power PDF, to mention a few.

      Are you just looking for a straight forward "fillable" forms replacement for Foxit?

Regards... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.