I am working in the POwer Builder 9 and my criteria is to print the
PDF files without opening the application and the code which i am
using this purpose is
ShellExecute( 0, 'open', ls_filename, ls_null, ls_filepath,3)
but that doesn't work..
anybody guide me to get the solution
when you drag a pdf file directly onto a printer's icon, it issues a
shell execute "printto" command (instead of open as in your example)
passing the printer name as a parameter. I'm certain with a little
more research you can work out the rest...
Sarathu,
Here is the declaration:
FUNCTION long ShellExecuteW (long hwnd, string lpOperation, string
lpFile, string lpParameters, string lpDirectory,integer nShowCmd )
LIBRARY "shell32"
The call:
//Set temp pdf printer driver
ls_set_printer = 'PDFCreator,winspool,Ne00:' //New printer name, we
use PDF creator.
li_rtn = RegistryGet( 'HKEY_CURRENT_USER\Software\Microsoft\Windows NT
\CurrentVersion\Windows' , 'Device', RegString!, ls_current_printer)
li_rtn = RegistrySet( 'HKEY_CURRENT_USER\Software\Microsoft\Windows NT
\CurrentVersion\Windows' , 'Device', RegString!, ls_set_printer)
ll_handle = Handle(this)
SetNull(ls_null)
ShellExecuteW ( ll_handle, 'print', ls_word_filename, ls_null,
ls_directory, 3)
//Then reset back to current printer once PDF printing is done.
RegistrySet( 'HKEY_CURRENT_USER\Software\Microsoft\Windows NT
\CurrentVersion\Windows', 'Device', RegString!, ls_current_printer)
Always identify the version AND BUILD that you are using.
> PDF files without opening the application and the code which i am
> using this purpose is
>
> ShellExecute( 0, 'open', ls_filename, ls_null, ls_filepath,3)
>
> but that doesn't work..
Define "doesn't work". The "open" verb obviously isn't what you want - did
you try "print". What is the value of ls_filepath? Did you read the
documentation about the shellexecute function on MSDN to verify that you are
using it correctly? What is the return value of the function?
>
> anybody guide me to get the solution
From a technical standpoint, this method does invoke the associated
application but relieves you from having to determine all the details about
which application is intended for this file type. As stated, your
requirements cannot be met - some program must be invoked to accomplish the
printing.
Arthur
--
Thanks for reply
Sorry that was a mistake ...Actually that was 'print' but then also
that doesn't work
Note that the Adobe Reader is the only application I've seen that
remains open after you print something using that method. You may
need to address that as well.
http://www.biopdf.com/acrowrap/close_adobe_reader.php
On Wed, 6 Jan 2010 02:57:20 -0800 (PST), Sarathu <sara...@gmail.com>
wrote:
-----------------------------------
My Web 2.0 Stuff
Blog: http://bruce.pbdjmagazine.com/
Facebook: http://www.facebook.com/people/Bruce-Armstrong/1600223798
Fotki: http://public.fotki.com/brucearmstrong/
LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
Twitter: http://twitter.com/bruce_armstrong
YouTube: http://www.youtube.com/user/brucearmstrong