Printing HTML

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
benhogan
Posts: 10
Joined: Tue Sep 09 2003

Printing HTML

Post by benhogan »

Hi,

What is the best way to print a HTML document using the PDF Converter without any dialogs. I am trying to use the Web Browser control but it doesn't seem to work at runtime. Any help will be most appreciated.

Ben.
benhogan
Posts: 10
Joined: Tue Sep 09 2003

Using Word

Post by benhogan »

Hi,

I should also add that i have tried using MS Word but it doesn't format content inside <PRE></PRE> tags properly.

Ben.
RandyHann
Posts: 3
Joined: Fri Oct 24 2003

Post by RandyHann »

Did you find a solution.

I am also trying here to print my .html to .pdf WITHOUT any dialog boxes. I keep getting the "Print" box to confirm the printing of the .pdf.

If i press "print" it works ok, but i do not want this box.

i also trying changing the deafult app of my .html to word...no luck

i am using XP Pro and IE6.0


Aaaauuuggghhhh !!!!!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hi,

Did you try our HTML2PDF ?

You may download it from: http://www.amyuni.com/en/support/downloads.html

Please note that the 'page 1 of x is printing' dialog box is not generated from our PDF Converter, it is generated by the application you are using to open your html files and print them.

Hope this helps.
RandyHann
Posts: 3
Joined: Fri Oct 24 2003

HTML2PDF.exe not working, so trying to create a diff solutio

Post by RandyHann »

I did try the html2pdf.exe, with NO luck. It either just doesnt bring back a .pdf or it sits in my Task Manager until i manually kill it.

I have been playing with a few ways this weekend to get this printing a .html to a .pdf without the dialog box.

This is as close as i have gotten.

I am now trying to use the Web Browswer activeX to print the .html thru the Amyuni printer driver; with some sucess, but not entirely yet.

I am using PowerBuilder (as this is what i am familar with), to embed the Web Browser activeX. I create a .exe of my PB app so that i can run it from my other app/framework (java based).

I first setup the Amyuni PDF with the DefaultFileName of the .pdf i want, then i run my PB exe passing the filename of the .html to print.

The PB app first does a ole_1.object.Navigate2( filename ) to load the page into the control

Then, on the DocumentComplete event, i then execute ole_1.object.ExecWB(6,2) which prints to the default printer the page in the control, WITHOUT the dialog box, as i wanted.

This is all good.

HOWEVER, when i put the close(w_main) statement after the ExecWB(6,2) statement, i find the .pdf does NOT get created.

This is either a timing issue i think.....the ExecWB needs time to complete BEFORE the close window can happen.......

but i cannot seem to figure out out to pass that necessary time....i cant find the/a event triggred whent the ExecWB is complete...crap! and putting a loop of int counter 1 to ???? just seems to freeze all processing....

so, thats where i am, after now almost 3 days of pissn around with this, i still dont have a full thru solution i am happy with

ideally, if the darm HTML2PDF.exe did work, this would solve my problems, but it dont seem too

Note, my solution also is kinda crap, as it will be single thread...i will not be able to allow TWO processes doing PDF printings at same time, as both would be using the same Printer Defintion and setting/resetting the DefaultFileName on each other....bad!

IF ANYONE can show me how to get this darm Html2PDF.exe working, i would greatly appreciate your assistance.


Thanks

Randy
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Randy,

I tried to call:

C:\Tech Support\Applications (samples)\Our Tools\html2pdf>html2pdf "www.amyuni.c
om" "c:\temp\testamyuni.pdf" "Amyuni PDF Converter"

From the C:\ prompt and I didn't get any error, I get a pdf file called testamyuni.pdf under C:\Temp.

So i am not sure why you are having problems running HTML2PDF, but I can try to help you there:

Please try to check that you are calling HTML2PDF Properly, that you are waiting a couple of seconds for the pdf file to be opened and printing starts and that you are using existing directories in your call.

Also please check that the printer is properly installed on your system and that it is enabled.

If you are still facing problems running HTML2PDF, please contact canada.support@amyuni.com and provide our helpdesk with your your contact information so they can get back to your and check what is the problem.

Concerning the solution that you suggested. You may use it in Multithreading if you use the locking mechanism of CDIntf.

Also you may know when printing ends if you catch the events generated by the driver when printing.

We can send you sampls on using the locking mechanism and catching events if you contact us at support@amyuni.com

Hope this helps.
Post Reply