I have one ASP(or PHP) page to generate one HTML page with different length. I'd like to provide user with PDF file format downloading. I searched a lot of solutions, with little success. (My server is Windows 2000, IIS)
One easy solution is using Adobe FDF tools. But it need the fixed length fields and fix contents in each page. My Asp page will generate different sized memo fields which FDF won't work out.
Another one is HTMLDOC tools (www.easysw.com). It basically "print" the input file to an output file, which is very sufficient for my problem. But it requires an input file in HTML, and an output file to the web server. This won't work, because in this way I need to generate the HTML file (not existing in the server) from the asp and save it to some unique temp name, then run the shell exe, save the output to the file with another unique temp name. This will cause huge trouble of the server storage and security problems.
They did offer some sample in Perl to get the input from the memory stream, which I can't make it work in windows machine.
So my troubles are:
1. ASP sending different sized HTML stream to the browser. After user click some button on that page, I need find a way to get all the HTML source (in memory only) to feed to some COM or EXE.
2. Get the PDF output from the COM, and then sending the PDF to user. (Memory only).
3. User using PDF plug in to view the PDF stream, and discard it or save it using PDF reader button in the browser.
4. The contents of the HTML is dynamic, the size of the contents, or the size of each field (or section) will change. So only the PDF "print" approach will work. The generating PDF on the fly approach won't work, because it is hard to figure out when to close the current page and create a new pdf page. How many lines of html or text should be put in that page(taken consideration of different font and style of the text and different graphic images.).
All suggestions are greatly appreciated.
Thanks.