Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 6741 times and has 4 replies Next Thread
Female nybelle
Stranger




Joined: May 15, 2006
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
How to print HTML to PDF

Hi all,

I know this is probably more related to web development, but I thought I'd give it a shot.

I have a pretty complicated site written in ASP. On one of my pages, I have a header, the top area, and then the middle area which changes when I click on different links, but the url remains the same.

I need to figure out how to print the middle area. When I just do a print page, it doesn't come out formatted correctly at all. I've been playing around with printing/converting to PDF, which works well, except that most pdf components expect a URL to print, and in this case my url is generic..it doesn't point to a specific page.

Any ideas??? I'm stumped!

[May 15, 2006 10:00:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male newseed
Advanced Member
Member's Avatar


Joined: Apr 2, 2005
Post Count: 2139
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to print HTML to PDF

I find that using CSS is the way to go. My first attempt in doing this was successful. Read this article here on how to do it.

http://www.killersites.com/articles/newsletterArchive/Newsletter_Nov3_2003.htm
----------------------------------------
Success is based on how much you spend. If it's not money, then the alternative is your time.
The Kasper Group

[May 15, 2006 10:04:57 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to print HTML to PDF

Generally you would use CSS as mentioned to offer a print CSS.

You can try SnapFiles for free software to change HTML into PDF, or you just write the PDF yourself with the language for it.
[May 15, 2006 10:21:37 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male admin
Advanced Member
Member's Avatar


Joined: Jun 14, 2003
Post Count: 2936
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to print HTML to PDF

HI,

You have two options:

  • Create a PDF with a server-side language like PHP or ASP.
  • Use CSS to format your page.


Creating a PDF:

This will require that you use a little programming to target and format what you want to print ... or in other words, what parts of the page you want to print.

PHP has built in PDF capabilities and I would imagine that classic ASP would have some DLL that you can install and use.

CSS for page printing:

This is by far the easier thing to do. I wrote an article about CSS and printing web pages back in 2003. Wow, time flies!
----------------------------------------
Stefan Mischook
Check out the web design video store.
----------------------------------------
[Edit 1 times, last edit by admin at May 15, 2006 1:45:27 PM]
[May 15, 2006 1:44:53 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male shelfimage
Advanced Member
Member's Avatar

USA
Joined: Mar 24, 2005
Post Count: 3000
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to print HTML to PDF

I have a header, the top area, and then the middle area which changes when I click on different links, but the url remains the same.

I need to figure out how to print the middle area. When I just do a print page, it doesn't come out formatted correctly at all.


This sounds like frames. Use asp includes instead of frames and you will not have so many print problems.
----------------------------------------
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
Save the developers<!>
Maine Webworks
[May 16, 2006 10:22:13 AM] Show Printable Version of Post    View Member Profile    Send Private Message    mainewebworks    mainewebworks [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread