Link to home
Start Free TrialLog in
Avatar of prohacx
prohacx

asked on

Notes Generated HTML -> PDF

Hi there!

Does any of you guys know about a good solution to convert on the fly generated (dynamic) HTML pages to (streamed) PDF files?

I have a Notes Website that generates quarterly reports (HTML), but the problem is that they should be output in PDF...

I'm especially interested in Domino plugins or Adobe solutions that can help me do this.

Thanx in advance!

Avatar of CRAK
CRAK
Flag of Netherlands image

Why html to pdf, not notes to pdf?
If acrobat is installed on your server, you should be able to convert documents to pdf using the available OLE classes in Lotusscript. You'll probably have to save the report to pdf, attach it on a notes document and launch the attachment through an url.
Never tried it though....
Avatar of prohacx
prohacx

ASKER

Hi, thanx for your response!

The HTML form we create consists out of 3 different kinds of info:

- static (pass-thru) HTML
- domino design text
- DHTML editor components that are being printed in text fields
- computed for display fields that use the WQO to generate data from the DB.

As you can see, we cannot convert the Notes form to PDF, since all HTML related stuff needs to be parsed first to achieve a nice visualized report. This needs to be converted then to PDF.

Any other thoughts?

You can try using HTMLDOC. It converts HTML TO PDF, now that said it's a freeware so it will have its own set of limitations...


But the easiest would be call this HTMLDOC from an agent and run thru it..

Try it here: http://www.bluem.net/downloads/htmldoc_en/



Partha
Avatar of prohacx

ASKER

Thanx partha, I will try your suggestion and see what it gives...

Don't worry about points, I will probably not be able to look into it for a week or so. I'll come back to you then. In case I should forget: simply post a comment here.

Meanwhile: other suggestions are welcome of course!
Points???? who was worried???.. I believe both me and crak never talked abt points?.. anyway try my suggestion

-Partha
I didn't! But speaking of points......
Interesting product partha. Amazing what good stuff is out there for free!

What I dont understand prohacx, is why this thing cannot be created in the back-end. Pass-through html can often be replaced by prefab stuff in notes fields or computed texts. All the rest appear to be computations. Unless.... what exactly is "the WQO"?
I did construct word documents in the past, based on templates (filling out fields etc.). I have seen people adding graphs to such templates by means of feeding MS Graph objects in the template the right data. Saving the word object to pdf shouln't be that hard.
Although partha's solution could be easier.....

Partha,

Thanks for posting this link. It is really nice to know about this free tool.
Avatar of prohacx

ASKER

The problem is that my form is quite complex.

What I'm looking for is a tool that converts the exisitng HTML on the fly.

Creating a PDF file myself would be another solution, but you know how that goes: you make an agent that build the PDF for a given form, and 2 months later, you have to change it, or you have to redo all the work for another form. Of course you can implement the whole HTML parsing stuff yourself, but why bother when such things exist and can be bought?

I'm on a tight schedule here, so that's why I ask.

WQO: Web Query Open.
On my form, I put 60 fields. When the document is created, it is done so through a web form. The users fill in all data. On this webform, 20 or so DHTML rich text components. These are NOT the Notes rich text fields, but DHTML code provided by Microsoft. The resulting HTML is stored in the document. When I open the print form, I populate the 60 fields with all HTML data from the DHTML rich text fields. There are currently 60 fields on this form for the 20 DHTML fields, because text fields in notes have a 32K boundary.

This results into a nice report, viewable in a browser, because of the HTML in all those fields. If I were to convert this HTML to Notes fields, I could as well write the whole PDF generation myself, so that's my problem: I want a quick, easy to implement way to generate the PDF automatically, preferable scalable to all other forms that might need to be converted in the future.

Forget about the whole points remark I made previously: I just know that some experts are keen on getting their points quickly. You guys really try to provide a good solution, so I'll look into it first.

Thanks in advance!
Notes to PDF can also be done by NotesToPaper. It's not for free, but it comes with an excellent form-designer. See www.notestopaper.com
Avatar of prohacx

ASKER

Thanks for the tip Sjef!

Have you used this tool? Do you think it's capable of converting HTML to PDF?

COnvertig HTML to PDF? I never tried that, so I'm afraid you'll have to ask them. They're very reponsive, usually.

If all you need is a screen-print dumped to PDF, then look for PDF995. That's a utility that installs as a printer, captures print-output and sends it to a PDF file. For free, if you don't mind the ad. See http://pdf995.com
If you don't want to buy tools, download the PDF SDK from Adobe website and code it using LotusScript and OLE.  In addition, you need to have full version of Adobe Acrobat (not just the reader) on the machine where your lotus script runs.  
Avatar of prohacx

ASKER

Thanks for all your answers guys!

Sadly enough, we don't really want to put time and effort into coding the entire form so that it exports the PDF, which is the best solution of course.

What we're looking into right now is to optimize the HTML so that it can be printed nicely. I used the onbeforeprint event to format the pages better (using a different stylesheet for the printer media) and added some javascript to correct the incorrect HTML generated by Notes so that we can determine page numbers and stuff.

Hope this will work eventually...
Do you want my prophecy? Probably not, but I'll give it anyway: if you go this way, you'll never get what you want and the cost will be (much) higher in the end. If you buy a $1000 tool, it's the equivalent of 20 hours work, that's only 2.5 days!

I know what you're going to say: But that's from the investments budget! In my view it's administrative nonsense hindering progress.
Avatar of prohacx

ASKER

Sjef: cheap hourly rates you have overthere ;-)

I agree: if we found a program that does everything, we'd most certainly buy it, but we can't find such a thing!

There are lots of programs that pretend they're a printer and generate a PDF file in the end, but that's not really it... But maybe we'll have to go with something like that after all...

I also agree that going the CSS/Javascript way is much less reliable (because you'll have to make sure your HTML is correct to start with), but it's much more scalable. Once we've done this for one form/page, we can use the same code over and over again in all pages, instead of programming an agent that generates a given PDF version of a given form.

Anyways, I'll discuss this issue again when I work on the project tomorrow or in 2 weeks...
Internal rates ;)

I'd love to see the outcome of your approach. And if the result is the same in all browsers, or is there only one browser?

Please keep us posted!

Sjef
ASKER CERTIFIED SOLUTION
Avatar of traderres
traderres
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It all seems mighty complicated to me. Did you check the NotesToPaper product? You won't need (expensive) Adobe products.

But if it works for you... Good job!
Complicated, perhaps.  But, most generic solutions are.  

NotesToPaper?  Haven't heard of it.  

Clearly, an inexpensive and simple HTML2PDF product would be handy.  But, it's a deceptively hard problem.  There are many versions of HTML (do you support CSS, and if so what version).  There are many versions of PDF (Adobe keeps adding new bells & whistles).  
Pls read all posts in this question... Food for thought!