1. vignesh ramkumar
  2. PowerBuilder
  3. Monday, 3 May 2021 10:20 AM UTC

Hi ,

I have one requirement, I need to print the PDF files from my local folder to default printer in my pb2019 application.

I am using following code:

Local External Function:

 Function long ShellExecute( long hwnd,  string lpOperation, string lpFile, string lpParameters,  string lpDirectory,  integer nShowCmd ) Library "shell32.dll"  alias for "ShellExecuteW"

 

Script

 

Long ll_return


string ls_null
long ll_null

SetNull(ls_null)
SetNull(ll_null)

IF FileExists(as_path) then
ll_return = ShellExecute(ll_null, "print", as_path, ls_null, ls_null, 0)
else
Messagebox('Print Error','File : '+as_path+' does not exists to print')
End IF

 

Issues

1. While executing the above script the adobe is keep on opening and user needs to close the adobe application manually

2. In some PC the default viewer of PDF is Miscrosoft Edge Browser because of that the above script not printing any pdf to printer - Workaround i did was manually went to PC and change the PDF file viewer to Adobe and tried but still the point 1 issue came.

 

Please help to sort of this problem i need to print the PDF files from the folder through my pb 2019 application and it should print silently in the background.

 

Thanks

Vignesh

René Ullrich Accepted Answer Pending Moderation
  1. Monday, 3 May 2021 10:36 AM UTC
  2. PowerBuilder
  3. # 1

Maybe this tool can help you:

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

 

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.