You need to be logged in to view a user's profile.
  1. Tracy Lamb
  2. PowerBuilder
  3. Friday, 31 May 2024 14:55 PM UTC

Me again!

Is there a way to print a pdf document within my app? Right now I can do it, but it uses the shell command...

lb_printed = lnv_runandwait.ShellRun( as_directory + as_filename, "print", 0)

The shell command will use the windows default PDF program to actually execute the print function.  In our case, it's Adobe Acrobat.

TIA,
~~~Tracy

Bruce Armstrong Accepted Answer Pending Moderation
  1. Saturday, 1 June 2024 20:05 PM UTC
  2. PowerBuilder
  3. # 1

You might take a look at:

This takes the same approach, but used a batch file rather than ShellExecuteEx:
https://www.appeon.com/developers/get-help/knowledgebase/powerbuilder-printing-pdfs-using-acrobat-reader.html

T
his lists a number of other options:
https://community.appeon.com/index.php/qna/q-a/pdf-documents-print-option

We use the shellexecute approach, as you do.  As you may have noticed, Adobe leaves an empty minimized reader around after you do a print.  That's why the solution first link above kills the Adobe Process when the print is completed.

Comment
There are no comments made yet.
Tracy Lamb Accepted Answer Pending Moderation
  1. Saturday, 1 June 2024 15:45 PM UTC
  2. PowerBuilder
  3. # 2

Looks like the problem my beta tester has is that last time he used Acrobat Reader, he printed to pdf instead of printing to a printer.  Acrobat somehow remembers the last Print option used. When printing from my app, Acrobat will ask where to print the file... 

Comment
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Saturday, 1 June 2024 12:07 PM UTC
  2. PowerBuilder
  3. # 3
Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 31 May 2024 19:36 PM UTC
  2. PowerBuilder
  3. # 4

You can still use the IE browser control. You have to have Adobe installed in order to view a PDF. My code example has a function of_execwb_print that can be used to print.

https://www.topwizprogramming.com/freecode_webbrowser.html

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 31 May 2024 16:48 PM UTC
  2. PowerBuilder
  3. # 5

Hi Tracy;

  Not currently - only in the Web Browser control which has a PrintAsPDF() method. However neither the DW Control or the DataStore control has this method support currently. This would require an enhancement to the DS/DC Native PDF feature.

  However, you can do this with external tool;s (ie: Ayumini) but, these would require an extra purchase & programming.

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.