Front Office Football Central  

Go Back   Front Office Football Central > Archives > FOFC Archive
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 09-16-2009, 10:18 PM   #1
PackerFanatic
Pro Starter
 
Join Date: Jul 2005
Location: Appleton, WI
HTML to PDF - for the techies out there

I am attempting to print off this sexy looking page, but because it has background colors, it won't print without going into the print settings of your browser and checking an option to "print background colors" (pretty stupid if you ask me) So the next option we thought of was to convert it to a PDF and print it that way. Sounds fairly straight-forward - but I can't seem to find a decent HTML to PDF tool. The page is built in PHP, and it is fairly dynamic (here is an example)

Truck Schedule

Using the two query params, it goes out to a DB and gets the data needed. It had been rendering the calendars with javascript, but I thought printing it all via PHP (which would then print all the HTML to the screen) would be easier for the PDF. But most of the tools I have tried using don't like the dynamicness of the page. Am I making this more difficult than I need to? Has anyone tried to do something like this? Any feedback would be greatly appreciated - thanks
__________________
Commissioner of the RNFL

PackerFanatic is offline   Reply With Quote
Old 09-16-2009, 10:30 PM   #2
GoldenEagle
Grizzled Veteran
 
Join Date: Dec 2002
Location: Little Rock, AR
PrimoPDF is the thing that I use for this kind of stuff. But I just tried to do it and was able to generate the PDF fine, but the background colors on the calendar are not showing up.
__________________
Xbox 360 Gamer Tag: GoldenEagle014
GoldenEagle is offline   Reply With Quote
Old 09-16-2009, 10:30 PM   #3
JonInMiddleGA
Hall Of Famer
 
Join Date: Nov 2000
Location: Behind Enemy Lines in Athens, GA
Maybe I'm just a little confused but ... I think I've got the .pdf you're trying to get.

When I went to "Save page as .pdf" in my Firefox, it ran through the plug-in from PDF Download — Free Tools to Create, Control and Convert Web-Based PDF Files

Unlike when I tried to simply print the page to .pdf myself normally (which dropped the background colors out of the calendar cells), their conversion which popped up as a d'loadable after less than minute seems to include the background colors just fine. PM me an email address & I'll send you the .pdf I've got so you can see if it's what you're trying to accomplish.
__________________
"I lit another cigarette. Unless I specifically inform you to the contrary, I am always lighting another cigarette." - from a novel by Martin Amis
JonInMiddleGA is offline   Reply With Quote
Old 09-16-2009, 10:31 PM   #4
Fidatelo
Pro Starter
 
Join Date: Nov 2002
Location: Winnipeg, MB
You should be able to get a printer driver that will just print to pdf. I'll look around.
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime."
Fidatelo is offline   Reply With Quote
Old 09-16-2009, 10:32 PM   #5
Fidatelo
Pro Starter
 
Join Date: Nov 2002
Location: Winnipeg, MB
Dola

I think this is the one I've used in the past, but there are millions, just google "pdf printer driver free".

pdf 995: create PDF documents easily for free
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime."
Fidatelo is offline   Reply With Quote
Old 09-16-2009, 10:38 PM   #6
JonInMiddleGA
Hall Of Famer
 
Join Date: Nov 2000
Location: Behind Enemy Lines in Athens, GA
FWIW, .pdf 995 is the pdf printer driver I've used for several years. This happens to be one of the fairly rare times where it isn't reproducing exactly what shows up on screen in the .pdf (it's dropping the background shading in the date cells).

edit to add: But otherwise it's been a lifesaving find for me, it's extremely unusual where it doesn't do exactly what I want/need it to do, probably less than once a year that happens.
__________________
"I lit another cigarette. Unless I specifically inform you to the contrary, I am always lighting another cigarette." - from a novel by Martin Amis

Last edited by JonInMiddleGA : 09-16-2009 at 10:39 PM.
JonInMiddleGA is offline   Reply With Quote
Old 09-17-2009, 08:08 AM   #7
PackerFanatic
Pro Starter
 
Join Date: Jul 2005
Location: Appleton, WI
I was hoping to find a programmatic solution, because we don't want to have to make the users change settings or install drivers (just from an ease-of-use perspective)

JIMGA - I tried that pdfdownload site (used the bookmarklet) and it didn't take the query string parameters into account.
__________________
Commissioner of the RNFL
PackerFanatic is offline   Reply With Quote
Old 09-17-2009, 08:12 AM   #8
Ronnie Dobbs2
Pro Rookie
 
Join Date: Jun 2012
Location: Bahston Mass
PackerFanatic,

I tried to do something similar (dynamically created .pdfs from php) uisng FPDF (FPDF) but found it clunky and inflexible and decided to use CSS instead to format the way I wanted to. YMMV.
__________________
There's no I in Teamocil, at least not where you'd think
Ronnie Dobbs2 is offline   Reply With Quote
Old 09-17-2009, 08:16 AM   #9
Coffee Warlord
Head Coach
 
Join Date: Oct 2002
Location: Colorado Springs
FPDF is alright, though as said, it can be a bit inflexible. Clunky...eh, I picked it up quite easily, but formatting is indeed a bit of a pain on it.

Last edited by Coffee Warlord : 09-17-2009 at 08:17 AM.
Coffee Warlord is offline   Reply With Quote
Old 09-17-2009, 08:21 AM   #10
PackerFanatic
Pro Starter
 
Join Date: Jul 2005
Location: Appleton, WI
I had seen FPDF, but didn't see anything that allowed me just to print out a whole HTML page that was already built and formatted. So you just created the page using that class?
__________________
Commissioner of the RNFL

Last edited by PackerFanatic : 09-17-2009 at 08:22 AM.
PackerFanatic is offline   Reply With Quote
Old 09-17-2009, 08:35 AM   #11
Coffee Warlord
Head Coach
 
Join Date: Oct 2002
Location: Colorado Springs
Oh oh, that, you need some extra stuff to do. If you're using PHP, I know there's a couple modules that need to be built in. Again, if you're using PHP, google pdf generation php (or something like that), you'll find the one I saw that could do that.

Last edited by Coffee Warlord : 09-17-2009 at 08:37 AM.
Coffee Warlord is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 09:33 PM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.