PDF Converter 2.5 not working with PB 10.2

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
klocksin
Posts: 5
Joined: Tue Oct 01 2002
Location: Ocean View, NJ
Contact:

PDF Converter 2.5 not working with PB 10.2

Post by klocksin » Tue Dec 05 2006

I'm evaluating the PDF Converter 2.5 product to ensure it works with my existing software developed using PB 10.2. I have been using an old 1.5x version of the PDF Converter which is working using PB 10.2. I have 2 new requirements that can't be handled with the older version of PDF Converter, multi-lingual (Cyrillic character set specifically) and running my application under Terminal Server using Citrix Presentation Mgr. I've looked thru most of the posts on the PB Community and have reworked some of my old code based on what I've learned, but I'm still not getting any output AND the "SetFileNameOptions" doesn't prompt me when attempting to overwrite an existing file (as it always does using your older version) and I have updated my function definition to "long" instead of "int"!!! Any help would be greatly appreciated since I find myself in a position where if I don't upgrade to your latest version, I can't provide this functionality that my customers have grown accustomed to...
Thanks,
Jim K.
Jim K.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Wed Dec 06 2006

Hello

The PDF Converter works with version 10.2 of powerbuilder

In Powerbuilder 10 (starting PB 8 in fact) the datawindows are not printerd to the default printer of the system, they are printed to the specific printer set for the datawindow itself. this is done using PrintSetPrinter("My PDF Printer")
For a more complete sample code please check:
http://www.amyuni.com/forum/viewtopic.php?t=870

Also please check the first pages of the "Common Driver Interface 250.pdf" that you received with the new version, this will give you information on implementing the new version.

Please make sure to call EnablePrinter() with the right licnese name and activation code for version 2.5.

klocksin
Posts: 5
Joined: Tue Oct 01 2002
Location: Ocean View, NJ
Contact:

PDF Converter 2.50 with PB 10.2...

Post by klocksin » Wed Dec 06 2006

I had already seen the posting you referred me too and had made most of the changes as recommended. The only one I left out was the "PrintSetPrinter" function since I have a function that updates the registry for the default printer. Nevertheless, I added in this function and rebuilt my application so that now the function calls are virtually identical to your sample code in that posting (I use 4099 instead of 3 when calling the "SetFileNameOptions" function). I'm also using the Activation Code that was included with the "evaluation download". Now I'm getting the error message that the printer is not activated (-41), but I'm using the only Activation Code that I have available to me until I purchase the product which I'm not about to do until I know that it will work for me ("catch-22 situation"). Do you have any other ideas? I can send a copy of my exact code if you need me to.
Thanks,
Jim K.
Jim K.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Thu Dec 07 2006

Hi,

Activation code error -41 is easy to figure out, it means you are trying to activate a new version of the PDF Converter using an older activation code.

so it must be that the old activation code is being used by your application instead of the new code you got in Install.ini.

If youare still facing problems please feel free to send your code to suppport @amyuni.com to get it checked.

klocksin
Posts: 5
Joined: Tue Oct 01 2002
Location: Ocean View, NJ
Contact:

PDF Converter 2.50 problems with PB 10.2...

Post by klocksin » Thu Dec 07 2006

I've sent an email, as you suggested, to Support. I included the activation number which is actually part of my code anyway. If the code is not valid, please send me another code that will work so I can get this thing working. I really would like to upgrade but, obviously, it has to work before I'm going to pay for any upgrade (again, the old 1.5x version is still working well, just doesn't work in Terminal Server environment).

Thanks,
Jim K.
Jim K.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Mon Dec 11 2006

Hello,

I just monitor the forum and not technical support, i am sure the guys at tech support will check the activation code and send you a newer one if needed.

Version 1.5 doesn't work under citrix, version 2.51 works almost similarly to version 1.5 except for the activation code that didn't exist in 1.5.

Regards,
Joanna

klocksin
Posts: 5
Joined: Tue Oct 01 2002
Location: Ocean View, NJ
Contact:

PB10.x working with PDF Converter 2.5x

Post by klocksin » Mon Dec 11 2006

Working with your Technical Support team, we found the solution to this problem. PowerBuilder versions, starting with 10.0 forward, use Unicode exclusively! This is great for working with multi-lingual applications but sometimes causes problems when interfacing with 3rd-party packages (or even your own DLLs written in another language such as C). The problem was that the PDF Converter functions that take "string" parameters require ANSI (8-bit) encoded strings rather than the 16-bit Unicode strings that PowerBuilder passes by default. In order to resolve this issue, you need to "alias" your external function definition as follows:

FUNCTION long EnablePrinter (ulong hPDFPrinter, string szCompany, string szLicenseCode) LIBRARY "cdintf.dll" alias for "EnablePrinter;Ansi"

This forces PowerBuilder to convert the string parameters to ANSI 8-bit encoding which are then compatible with PDF Converter 2.5x.

Thanks for all your help with this,
Jim K.
Jim K.

Post Reply