ShellExecute - PrintTo - TIF - How To Call?

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Robertio
User
Posts: 5
Joined: Fri Mar 20, 2009 12:43 pm

ShellExecute - PrintTo - TIF - How To Call?

Post by Robertio »

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.
Robertio
User
Posts: 5
Joined: Fri Mar 20, 2009 12:43 pm

Re: ShellExecute - PrintTo - TIF - How To Call?

Post by Robertio »

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 :evil:
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: ShellExecute - PrintTo - TIF - How To Call?

Post by Ivan - Tracker Software »

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.