by Markus Schneider
Feedback
|
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days):
35691/
148
|
|
|
|
| The Code |
Step 2: Render some test pages to PDF
Before you start writing code be sure to test your printable pages by using our Test Form You may also test the html2pdf parameters like landscape, JPG quality, Hyperlinks etc. If you do not want to use the default values be sure to include them in your code.
Step 3: Write the code
There are several possibilities to set up your site for html2pdf.
A) If you simply want to render a standard page (not a special print page) you just need to put the following link to your "render this page to PDF button": http://html2pdf.adfinis.com/refer2pdf.php The Script will request the referer and render it to PDF.
B) If you want to insert the link in your current code the dynamic link on the "render this page to PDF button" should look something like this: http://html2pdf.adfinis.com/render.php?URL=encoded printer friendly full URL of current page&jpeg=60
Please note that the parameter jpeg is like all others (exept url!) optional!
C) If you would like to leave the current code of your pages untouched you may create a simple refer2pdf file and copy it on your server. Here are some examples for such a file:
refer2pdf.aspx using VB.NETrefer2pdf.asp using VBScript
This article was contributed by Markus Schneider and he can be reached at schneider@mms.ch |
|
|
|
|
Article Feedback
User Comments
Title:
CEO
Name:
Liz
Date:
4/28/2005 8:20:18 AM
Comment:
In order to create useful PDFs from HTML you first need to prepare the html Templates in a way that they can be printed without errors and malformating. Many state-of-the-art websites got a print button anyway or may be printed as they are without limitations. If your site is missing this feature you may create an additional dynamic template that ignores menus, banner, teasers etc. If your site isn't dynamic you should consider switching to a content management system!
|
|
Product Spotlight
|
|
|