1. Tracy Lamb
  2. PowerBuilder
  3. Saturday, 1 February 2020 20:00 PM UTC

My database has a table with links to PDF documents.  Can I send those PDFs to the printer from within my application?

TIA,
Tracy

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 3 February 2020 17:04 PM UTC
  2. PowerBuilder
  3. # 1
1
Votes
Undo

Hi Tracy;

  The easiest way (and what I do) is to use PB's "iNET" object class and the HyperLinkToURL() command to download the related PDF file into the App User's default web browser. Then from there, they can print all or part of the the PDF, change its size, font, orientation, etc as they desire from the browsers internal PDF / Print functionality.

Food for thought!  ;-)

HTH ... Chris

Comment
Thanks Chris, that's a very good idea too.

My application allows users to "attach" external documents to their lab folder. They don't want to view the documents after they're attached. They just want to press a button and print them along with the other reports from my app.
  1. Tracy Lamb
  2. Monday, 3 February 2020 17:44 PM UTC
Hi Tracy;

I have not tried this with a PDF but - "in theory" - using the new built-in Web Browser control in the PB2019 R2 release one could download the PDF to that control and then command it to print. Keeping the new Web Browser control invisible - should accomplish the PDF printing transparently. You can download the PB2019R2 Beta and try that today.

Also, you could try this today with any Appeon PB using Roland's web browser control ...

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

HTH

Regards ... Chris
  1. Chris Pollach @Appeon
  2. Monday, 3 February 2020 18:36 PM UTC
There are no comments made yet.
Georg Brodbeck Accepted Answer Pending Moderation
  1. Monday, 3 February 2020 09:39 AM UTC
  2. PowerBuilder
  3. # 2
0
Votes
Undo

Possible - yes. But you probably need to use some tricks:

Option 1: Use the run() function to print the PDF from command line (Adobe Reader or another PDF tool required) - just google "windows print pdf from command line".

Option 2: Embed Adobe Reader as OLE object (so you even have a print preview) - a print button is integrated in the OLE.

Hope this helps.

I think there's no PB native way to do this - or does anyone know a way?

Comment
Thanks... I'll look into that today.
  1. Tracy Lamb
  2. Monday, 3 February 2020 16:06 PM UTC
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.