1. Franky Ruzeré
  2. PowerBuilder
  3. Wednesday, 30 June 2021 14:10 PM UTC


I am migrating a client/server application from PowerBuilder 12.5 to PowerBuilder 2019 R3. 

We are using Amyuni PDF Converter version to create a PDF file from a report :

IF ab_concatinate THEN
SetFileNameOptions (al_handle, NoPrompt + UseFileName + Concatenate)

//Set the PDF printer as default
SetDefaultPrinter (al_handle)

//Print the dw
adw_datawindow.Print( FALSE )

//Reset the default printer


Function long SetDefaultPrinter (long hPrinter) library "cdintf600.dll" is declared as an local external function in the non-visual.




With PowerBuilder 12.5 and PowerBuilder 2019 R2 this works fine. It seems that "SetDefaultPrinter()" doesn't work anymore with PowerBuilder 2019 R3. I have tried several workarounds but for bigger reports I am getting the message "printer not activated, error code -30" after a while and NO PDF file is created.

I tried it by :

- changing the printer of de datawindow : adw_datawindow.Modify('DataWindow.Printer="'+ is_currentPDFPrinter +'"')

- using PrintSetPrinter() 



I have also done some tests with Amyuni PDF Converter version with which I have the same problem.





What should be the problem so that SetDefaultPrinter (al_handle) doesn't work anymore in PowerBuilder 2019 R3 ?

Or is there another way to solve my "printer not activated, error code -30" for bigger reports ?








Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 30 June 2021 14:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi Franky;

   The Error seems to be coming from the Amyuni product. If so, I would contact the Amyuni support team for this issue.

Regards ... Chris

  1. Franky Ruzeré
  2. Wednesday, 30 June 2021 14:29 PM UTC
Thanks for your quick reaction Chris.

But it is nevertheless strange the the SetDefaultPrinter() doesn't work any more in PowerBuilder 2019R3 while this was still working in PowerBuilder 2019R2.

Kind regards,


  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 30 June 2021 17:03 PM UTC
I cannot say ... other than the SetDefualtPrinter() is an external API call outside of the PB App & it's runtime that could be being blocked by the O/S, AV or even a privilege issue from something like Active Directory (for example)". Whereas, the "PrintSetPrinter" is PB's equivalent built-in command for this functionality.
  1. Helpful
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.