1. Ramón San Félix Ramón
  2. PowerBuilder
  3. Monday, 27 June 2022 11:10 AM UTC

Hello, I would like to know how to use the external functions of the WINSPOOL.drv library
to be able to send a PDF directly to the printer.

I've recently achieved this thanks to a GitHub project called RawPrint, creating a Net Core library to consume in PowerBuilder.


I imagine that this should be able to be implemented directly in PowerBuilder, I don't know if someone from the community could help me.


You may wonder why I want to achieve this, it is because in 64Bit environments the Adobe Acrobat Reader Control does not work to open and print PDF's.

I have replaced with the new WebBrowser control but I have found 2 problems.

The first is that it cannot be printed without opening the dialog box and the second is that there is no event that tells us when the loading of the PDF in the control has finished and in PDFs with many pages we cannot start printing until the pdf is there 100% loaded or a blank page comes out.

Sivaprakash BKR Accepted Answer Pending Moderation
  1. Thursday, 30 June 2022 08:15 AM UTC
  2. PowerBuilder
  3. # 1

May be this program (pdftoprinter.exe) will be of any use.   Check the following link.

http://www.columbia.edu/~em36/pdftoprinter.html

Happiness Always
BKR Sivaprakash

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 27 June 2022 13:42 PM UTC
  2. PowerBuilder
  3. # 2

I've published an extensive, four-part tutorial on how to interface PB with Windows API functions:

   https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/302-interfacing-pb-applications-with-the-windows-api-part-1

   https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/303-interfacing-pb-applications-with-the-windows-api-part-2

   https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/304-interfacing-pb-applications-with-the-windows-api-part-3

   https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/305-interfacing-pb-applications-with-the-windows-api-part-4

The tutorial includes a discussion of the differences between 32-bit and 64-bit versions of API functions, with illustrative examples to assist your understanding. The memory layout of members within structures can also differ, and I discuss this as well.

That being said, please be aware there are some facets of the Windows API that do not directly or easily translate to PB. Callback functions (passing the address of a function that Windows can invoke) is one such area. I've not examined the API functions related to printing and spooler functions that Roland provided, so I cannot comment on whether or where you might experience difficulties.

It might be more helpful if you could list the WinAPI functions you are wanting to utilize from PB.

Regards, John

Comment
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Monday, 27 June 2022 13:40 PM UTC
  2. PowerBuilder
  3. # 3

There's a bit of a problem with this. When you open the printer as a raw device, you're not going to get any printer codes generated in the process. If your printer can take a PDF and internally convert it, you might have a chance.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 27 June 2022 13:04 PM UTC
  2. PowerBuilder
  3. # 4
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.