1. Gunnar Gisleberg
  2. PowerBuilder
  3. Thursday, 15 February 2024 07:42 AM UTC

Hi

I am developing functinality to convert .jpg to pdf using webbrowser to open the file and save as pdf.

The problem is make script creating the web browser windows wait until the browser is finished opening the file save the pdf.

the webbrowser automatically saves the on naviagationcompleted event the PrintAsPDF method, but this event is not handled when running from a script function

 

Is there a solution to wait until a window has completed event handling when called from a script function?

When i run the debugger and breaks the browser finish ok - not when i run without debugger and using a very long sleep. The browser events does not complete.

 

Gunnar Gisleberg

Locus Solutions AS

Norway

 

Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 15 February 2024 08:45 AM UTC
  2. PowerBuilder
  3. # 1

Hi.

You should mention version of powerbuilder you are using. PB 2019 (depending on the exact fix release), 2021, 2022 and of course all older versions (2017 and older) do not use the same webbrowser control.

For your question, if you are on PB 2022 R2 or R3, then why not to use pdfbuilder?

If for some specific reason, you really need to work with webbrowser, it's ok. But you ask why something doesn't work ok, without providing any code. What do you mean by saying "but this event is not handled when running from a script function"? What kind of script? Are you referring on to pb script or some javascript?

Andreas.

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.