?
Solved

Notes Generated HTML -> PDF

Posted on 2005-02-28
20
Medium Priority
?
463 Views
Last Modified: 2013-12-18
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!

0
Comment
Question by:prohacx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 2
  • +3
20 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 13418461
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....
0
 
LVL 5

Author Comment

by:prohacx
ID: 13418690
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?

0
 
LVL 14

Expert Comment

by:p_partha
ID: 13419852
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
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 5

Author Comment

by:prohacx
ID: 13421140
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!
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13421285
Points???? who was worried???.. I believe both me and crak never talked abt points?.. anyway try my suggestion

-Partha
0
 
LVL 13

Expert Comment

by:CRAK
ID: 13423099
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.....

0
 
LVL 3

Expert Comment

by:sravikiran
ID: 13425557
Partha,

Thanks for posting this link. It is really nice to know about this free tool.
0
 
LVL 5

Author Comment

by:prohacx
ID: 13427233
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!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13427667
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
0
 
LVL 5

Author Comment

by:prohacx
ID: 13427897
Thanks for the tip Sjef!

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

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13428495
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
0
 
LVL 3

Expert Comment

by:sravikiran
ID: 13429177
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.  
0
 
LVL 5

Author Comment

by:prohacx
ID: 13907499
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...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13907532
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.
0
 
LVL 5

Author Comment

by:prohacx
ID: 13915812
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...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13915902
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
0
 
LVL 1

Accepted Solution

by:
traderres earned 2000 total points
ID: 14498833
I built a prototype website with this capability and it works.  The ASP pages generate an HTML string report,  convert the HTML string to an HTML file, and then to a PDF on-the-fly.

Here's the approach:
 1) Install Adobe 6 Professional on your web server (We're using win2000/IIS5).
     When you install Adobe 6 Professional, it will create a virtual print driver called "Adobe PDF" [allowing you to print to Adobe PDF].  Make "Adobe PDF" your default printer (on your windows web server).  This will only work if you keep a userid logged-in.  Printing is interactive, so you need a logged-in account.  But, the web server can be locked -- you just need someone to be logged-in.  Finally, in the Printing Preferences, make sure Adobe PDF does not prompt for a PDF filename.  So, when you print to PDF, Adobe will automatically creates the PDF file to your C:\Documents and Settings\<username>\My Documents\ directory..

2) Construct a VB DLL call that will
      a) write your HTML string to a file on your website -- c:\inetpub\wwwroot\rpt\rpt1.htm
      b) Open an InternetExplorer object and navigate to that newly-created HTML file
      c) Tell your InternetExplorer object to print it

3) Because your default printer is Adobe PDF, a PDF file will be created and written to
 the  C:\Documents and Settings\<username>\My Documents\.  Note, if your html file is called rpt1.htm, then your pdf file will be rpt1.pdf.

4) Then have your ASP page redirect the user to this newly-created PDF file.
   
Advantages of this approach:
 1) Using Adobe 6 PDF printing preferences, you can set how your newly-created PDF files appear [optimized/Adobe 1.2 or 1.3 specification,....]
 2) PDF files are text-selectable  [which our customers like]
 3) PDF files are high quality and look great [CSS in the HTML works flawlessly]
 4) PDF files are generated quickly
 5) You separate construction of your HTML report pages from the delivery of them.
     [thus, all of our ASP web pages can now export-to-PDF]


Disadvantages of this approach:
 1) It depends on the use of the InternetExplorer.application object -- which Microsoft will probably lock down on of these days
 2) Requires the web server to have a user logged-in.  Although, you could probably make a client/server daemon VB program listen in for these requests and generate PDF files.  But, there's no getting around it, you need a user logged-in to do the print requests.
 3) Requires spending money for Adobe 6 Professional
 4) May not be legal to use Adobe print-to-PDF on a server.  

In any event, this is a temporary approach.  My guess is that in a few months, our team will have more money for software, and we'll be able to buy one of Adobe's products.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 14500898
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!
0
 
LVL 1

Expert Comment

by:traderres
ID: 14502345
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).  
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 14502499
Pls read all posts in this question... Food for thought!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question