HTML to PDF "silent" print with VB6.

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
JMMetso
User
Posts: 2
Joined: Tue Jun 26, 2007 11:39 am

HTML to PDF "silent" print with VB6.

Post by JMMetso » Tue Jun 26, 2007 1:09 pm

Hi,

I'm evaluating trial version of PDF-XChange SDK and trying to convert HTML files to PDF. VB6 is used.

The ShellExecute call of VB example code pops up always a printer selection dialog (if HTML is printed) but I would need to do PDF conversion silently. And at the end I would need to merge several converted PDFs to one PDF document.

Is it possible with PDF-XChange SDK? Is there example code available?

Thanks,
Jaakko

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Jun 26, 2007 2:53 pm

Hi,

Yes indeed, to both questions - is the answer.

Please see either of the VB examples provided :

VBExAPI.exe
or
VBExCOM.exe

Both appear to do what you need - albeit possibly with some modification.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

JMMetso
User
Posts: 2
Joined: Tue Jun 26, 2007 11:39 am

Post by JMMetso » Wed Jun 27, 2007 6:39 am

Hi,

I have seen and tested those examples. I tried HTML - PDF conversion following ways:

1. ShellExecute(0, "printto", fn, pname, vbNull, SW_MINIMIZE)
- Here the problem was Printer selection dialog, which is always opened. I don't know how to prevent it from popping up.

2. IE_WebBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
- Here the problem is the default printer which is not PDF-XChange. So the document is printed by some other printer. Maybe I could somehow set the system default printer temporarily to PDF-XChange and then this could work?

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Jun 27, 2007 8:46 am

Hi,

yes, both examples rely on PDF-XChange being the default printer.
here is a description of how to do this (it is easy under W2k and later, and a bit tougher for W9x/Me/NT):

http://msdn2.microsoft.com/en-us/library/ms535468.aspx

HTH
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply