Create PDF from HTML-file

This Forum is for the use of Clarion For Windows - 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, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
mnikolai
User
Posts: 4
Joined: Thu Sep 15, 2005 3:39 pm

Create PDF from HTML-file

Post by mnikolai » Thu Sep 15, 2005 4:13 pm

Using docpdf30.app to create a pdf-file from a HTML-File does not work: Word is loaded, opens the html-file but does nothing.
Right clicking this file in Explorer and try to print it does the same, so I think that there is something wrong on my machine.
What can I do to print html-files?
Any registry settings to change to get Word or IE to print?
Regards,

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

Post by John - Tracker Supp » Thu Sep 15, 2005 4:31 pm

Hi,

You cannot print direct to the SDK version of the driver - you must code an app to print the output for you - i.e. use an app like the demo app docpdf30.app

If this is not working - can you confirm that you have :

1: Word installed
2: PDF-XChange 3 in your printers list (the PDF-XChange drivers must be installed to print from a 3rd party app such as Word to PDF-XChange)

If you have the PDF-XChange driver installed and Word - please advise what versions of Word and Windows you have installed.

Thanks
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

mnikolai
User
Posts: 4
Joined: Thu Sep 15, 2005 3:39 pm

Post by mnikolai » Thu Sep 15, 2005 4:44 pm

Hi,
thanks for your answer.
Word is installed, the driver is installed.
I am using the docpdf30.app to create pdf from html, it is loading word instead of IE or Firefox. It does not call the pdf Xchange Printer.
When I do a right click in Explorer to print the html-file it loads word as well. This shows to me that there is something wrong in my configuration.

Renaming the html-file to doc and using it with docpdf30 does work.

I think it is not a problem of pdf-xchange and it is because of any stupid setting on my machine but maybe you have an idea to solve this problem.
Word is 2003 (11.6502.6407) SP1
PDF Xchange was downloaded and installed today.
BTW: Can I run the specific app on my own to print and then call pdf-xchange?

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Thu Sep 15, 2005 5:24 pm

Hi mnikolai!

What you are seeing here is an aritfact of the Windows system. You are correct in thinking this is probably a "configuration problem."

The place you need to look at is found by opening Windows Explorer and looking at Menu Tools | Folder Options..., and selecting the File Types tab. Scroll down to the HTM file type and then click the Advanced button. You should see three items in the Actions list: Open, Edit, and Print.

Select the Print Action and click the Edit button to the right of the Actions list. You will then see the "Application used to perform action:" prompt and that will NOT be IE but an odd program name, something like: "C:\Program Files\Microsoft Office\Office\msohtmed.exe" with a %1 to the right of the name. This is the Office dispatcher which figures out which program REALLY needs to be run to perform the Action. In the case of your system it is choosing Word for the Print option. That seems to be a system default.

You could TRY changing the Application to use IE, just make sure you use a fully qualified path name and that you know what the command line needs to trigger printing, probably a /p before the file name.

(One other thing - there are Save.App.Run and Save.App.Params options in the Driver, but they do NOT control the printing of the document. They only apply AFTER the document has been printed to a PDF by the driver, and are used for "post processing" the resulting PDF file - usually calling Adobe Acrobat Reader or another PDF viewer.)
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

mnikolai
User
Posts: 4
Joined: Thu Sep 15, 2005 3:39 pm

Post by mnikolai » Fri Sep 16, 2005 3:57 pm

Thanks for your answer,
actually I didn't figure it out how to set the parameters to get the html-file printed via IE or Firefox, still working on it
While thinking about the great possibilities with PDF-XChange Drivers implemented in my apps I do fear the drawbacks that I have relying on other software AND settings to be able to create a pdf out of html before converting the file using PDF-XChange.
Once I am not able to make a html file print - I cannot create a pdf file.
So my question again:
Is creation of a rtf or html file with any other of your products easier?
Do you know of any other possibility to get this html file printed?
Is it possible to do an own Shellexecute or run command?

I am using FileExplorer from Capesoft which provides a fehtmlEditor that is able to print a html file. Is it possible to use this to print from fehtmlEditor?

While I like the template I like to know if it is possible to use the class/function in handcoded apps.
Regards,
Michael

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Wed Feb 15, 2006 7:35 pm

Hi Michael!

When called, msohtmed.exe determines from the file extension and command (Open, Edit, Print) which program to use and copies the rest of the command line in the File Type (or Association) to a new call to that program.

The place to look for how msohtmed.exe determines what program to use is found in the IE browser, Tools menu, Internet Options... dialog, Programs tab. The specific one you want is the first one, HTML Editor.

The main problem with automating any activity through a Windows program is that the Windows program must support DOS-style command line options.

Now Word and Excel do support command line options that allow you to instruct the program to Print a selected file. But IE and many other HTML-based Browsers don't. Hence the switch to Word when you want to Edit or Print.
I am using FileExplorer from Capesoft which provides a fehtmlEditor that is able to print a html file. Is it possible to use this to print from fehtmlEditor?
You could create a program in Clarion to handle this using FE I think. What you would have to do is make it capable of getting the filename from the command line using the COMMAND() function and then load that file into FE and then issuing a command to FE to print. That should work.

You would then have to go back to IE's File Types and change the Print command for html to use your program instead of calling msohtmed.exe, and ONLY use the "%1" on the command line to indicate the file name.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

kraj
User
Posts: 10
Joined: Tue Jan 25, 2005 8:49 pm

Post by kraj » Wed Feb 15, 2006 9:05 pm

Craig,

I just tried something which appears to work.
Using the demo app (docpdf30) I simply loaded an html file which had been saved to disk.
I loaded it into the test and it printed the PDF fine.

Onkly 2 issues I have are the following:

1. The printer dialog comes up
2. The PDF has the trial version watermarks

I was under the impression that it would work ok. Maybe I need a diferent license (I have the PDF Tools SDK license).

Regards,

Benjamin

kraj
User
Posts: 10
Joined: Tue Jan 25, 2005 8:49 pm

Post by kraj » Thu Feb 16, 2006 12:31 am

Craig,

Could you be so kind and run a test for me?
I am not certain what may be causing this and want to ascerain that wirh a SDK Pro license I will be able to accomplish what I want.

I will be using the Doc to PDF sample aplication as a baseline. The application will be run on a webserver in command-line mode. It will accept an input file name, an output file name, and some switches.

The application nees to generate the PDF totally in the background with no user intervention whatsoever.

I have taken the sample app as a proof of concept. I saved an HTML invoice which I generated from our web application and saved it to disk. So far, so good.
I load it as the source document into the example applicatio.
I set a target pdf filename.
I hit the print button. The printer selection dialog is always coming up with PDF Exchange as the default printer. However, it requires my intervention to hit the print button.

This would be the best method to achieve my objective. If this will not work, the alternative would be to create a File exploer control, load the file, and call its print method. However, I need to make sure that in either method I can print the PDF without the printer dialog appearing.

Your assistance will be deeply appreciated.

Regards,

Benjamin

kraj
User
Posts: 10
Joined: Tue Jan 25, 2005 8:49 pm

Post by kraj » Thu Feb 16, 2006 2:36 am

Craig,

There does not appear to be any way to suppress the printer dialog when using shellexecute on an html file.
I have tried many variations, and researched everywhere I could.

I think the only route will be by using a File Explorer object.

I am, however, running into something strange.
Applications printing natively via the PDFTools SDK are working fine.

The application which uses the PDF-Xchange driver is not printing properly - I am seeing the trial watermarks. If I print to my PDF-Xchange printer driver from any application (word, IE, etc.) the "trial copy" watermarks are not there.

I am using a registered copy of PDF-XChange 3.5 on my dev workstation.

Any ideas? My tps_lic.ic file does have my reg keys, and the problem only manifests itself when trying to control the PDF-XChange driver.

Could it be that I have a bad license key?

OS is XP Pro, all SP's. Clarion 6.3. Latest SDK (downloaded today)

TIA,

Benjamin

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

Post by John - Tracker Supp » Thu Feb 16, 2006 8:37 am

Hi Benjamin - I suspect you have worked this out -as I have an email from you also.

You have a PDF-Tools SDK license - which includes our DLL based PDF creation and manipulation methods etc - but not the use of the Low Level API, Digi Sigs and most importantly the Drivers SDK.

Will respond to your email directly with regards upgrading.
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

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Wed Feb 22, 2006 12:32 pm

Hi Michael and Benjamin!

We have created a new demo using our PDF-XChange Driver 3.0 interface and Capesoft's File Explorer to allow "silent" printing of HTML pages to PDF files.

The latest PDF-XChange downloads as of this writing have HTML2PDF.prj and HTML2PDF.clw. Yes this is hand-coded but not onerous. There is also a new Appendix A in the PDF-XChange Driver manual that explains this in a bit more detail.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

kraj
User
Posts: 10
Joined: Tue Jan 25, 2005 8:49 pm

Post by kraj » Thu Jun 29, 2006 11:58 pm

I just installed the latest release of the SDK (3.6102).

I tried to compile the HTML2PDF project for testing purposes.

The line

PXCDRV33:SaveInfo.WhenExists = PDFXCV3_WHENEXISTS_OVERWRITE

generated an error. I have searched all of the files and it appears that the equate for PDFXCV3_WHENEXISTS_OVERWRITE does not exist anywhere. I have checked the documentation (PDFXCDriver30.pdf) and found that overwrite should be 1.
You may want to add these equates to the .inc file.

Regards,

Benjamin

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

Post by John - Tracker Supp » Fri Jun 30, 2006 12:04 pm

thanks Benjamin,

will take a look ASAP !
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

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

Post by John - Tracker Supp » Sat Jul 01, 2006 6:20 pm

Hi Benjamin,

The entire driver template/class set has been given a thorough once over and all should now be well.

Thanks for your patience.
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

Return to “PDF-XChange Drivers (only) API SDK - For Clarion For Windows Developers only Please”