1. Gzim Ramizi
  2. PowerBuilder
  3. Tuesday, 6 June 2023 14:25 PM UTC

Hi all,

we are using WebBrowser-Control to show PDF. That works very well. Also, the icons/controls of the PDF are showing up, hence the user is able to print/download the file. Now, I would like to open the print dialog, like clicking on the printer icon by mouse (see attachment)... Is there a way how to trigger that event/function?

The printaspdf of webbrowser-control is in my case not really helpful.

 

PowerBuilder 2021 Build 1506 on Win11.

 

TIA,

gzim

Attachments (1)
Who is viewing this page
Accepted Answer
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 7 June 2023 01:07 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Gzim,

Please try Print fucntion of WebBrowser control, for example:
wb_1.print()

Regards,
Kai

Comment
  1. Gzim Ramizi
  2. Wednesday, 7 June 2023 07:26 AM UTC
...sometimes life is easier than one thinks. That's exactly what i had tried (and it worked), but didn't get around to informing here in the forum. Anyway, thank you very much!
  1. Helpful 2
There are no comments made yet.
Rob Stevens Accepted Answer Pending Moderation
  1. Wednesday, 23 August 2023 22:55 PM UTC
  2. PowerBuilder
  3. # 1

Hi

We have been using acrobat reader and dde to bulk print files (we need to know whether the print succeeds or not hence dde). I've started looking into using the webbrowser control instead.

How do you suppress the print dialog when using the Print() function? I can't seem find syntax documentation on this function specific to the webbrowser control.

Regards

Rob

Comment
  1. Kai Zhao @Appeon
  2. Thursday, 24 August 2023 00:23 AM UTC
There is no feasible way to suppress the print dialog when using the Print() function. I will record it as a new enhancement/requirement request and will transfer it to our product team for consideration.

Please try using PrintAsPDF(string PdfFile) to print web page as a PDF file without the user dialog, then you can print the PDF file by using the external function ShellExecuteW(). Please refer to the article below to print pdf file.

https://community.appeon.com/index.php/qna/q-a/can-i-print-pdf-docs-from-my-application

https://www.rgagnon.com/pbdetails/pb-0008.html
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 6 June 2023 18:48 PM UTC
  2. PowerBuilder
  3. # 2

Hi Gzim;

  1. Note that PB 2021 is not certified for W11 use. Only PB 2022 is certified for the W11 O/S thus far.
  2. You would need to write some JavaScript and then use the EvaluateJavascriptxxxx command to run the JS which would then fire that print command button.

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.