Sorry if this is in the wrong section, but how do I get PrintTo to print a tif file to pdf? (am using Delphi 6)
The line below works for a Word document:
ShellExecute(HWND(nil), 'printto', PChar('C:\sample.doc'), PChar('"' + 'PDF-XChange 4.0' + '"'), nil, SW_MAXIMIZE);
Where as the same code for a tif does not:
ShellExecute(HWND(nil), 'printto', PChar('C:\sample.tif'), PChar('"' + 'PDF-XChange 4.0' + '"'), nil, SW_MAXIMIZE);
Run through debug it skips over the line in a fraction of a second as if it is doing nothing.
The full routine sets the print options, etc. but I've simplified it down to the bare minimum for the sample. If I manually open the tif I can print it to the PDF-XChange 4.0 printer, so as far as I can tell it should work. I have tried this on multiple machines (XP SP2) and get the same on all of them.
ShellExecute - PrintTo - TIF - How To Call?
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- User
- Posts: 5
- Joined: Fri Mar 20, 2009 12:43 pm
-
- User
- Posts: 5
- Joined: Fri Mar 20, 2009 12:43 pm
Re: ShellExecute - PrintTo - TIF - How To Call?
Managed to resolve this by setting the printto file association to
rundll32.exe C:\Windows\system32\shimgvw.dll,ImageView_PrintTo /pt "%1" "%2" "%3" "%4"
For whatever reason it wouldn't work with FaxMaker or Paint.
Now have the problem of it printing a blank PDF when using a CPXCPrinter rather than using the name of the installed printer. Why it has to behave differently for a tif and an doc is beyond me
rundll32.exe C:\Windows\system32\shimgvw.dll,ImageView_PrintTo /pt "%1" "%2" "%3" "%4"
For whatever reason it wouldn't work with FaxMaker or Paint.
Now have the problem of it printing a blank PDF when using a CPXCPrinter rather than using the name of the installed printer. Why it has to behave differently for a tif and an doc is beyond me
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: ShellExecute - PrintTo - TIF - How To Call?
PDF-XChange doesn't handle print, or printto verbs for files -- all is dependant on the application which handle's corresponding file type.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.