Print Stylesheet in Safari

Phreaddee

Super Moderator
Staff member
Hi guys,

I have a project that I am working on whereby the client needs to turn a webpage into a pdf and then print it. As such I've created a print stylesheet.

The client is to use safari to print as I've found that it is the best browser for turning into a pdf. but there is one problem I have come across and that is a multi-column layout, firefox seems to be able to print out multi-columns yet safari/chrome does not. does any one know a work around to this, I dont want to use firefox to print as it seems to ruin the rest of the layout.

this isnt the whole layout but a simple 2-col div test. run this in firefox to print and it will output 2 columns, but not in safari. this is frustrating and confusing.

HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" >
<title>2 Col Test</title>
</head>
<style>
div {
	width:800px;
	-webkit-column-count:2;
	-moz-column-count:2;
	column-count:2;
}
</style>
<body>
<div>
<p>Donec ac rhoncus nibh. Aliquam erat volutpat. Suspendisse potenti. Donec sit amet nisi ut nunc tincidunt rutrum. Aliquam sit amet dui metus. Praesent blandit nisi non ipsum mollis feugiat. Nullam eget felis magna, vel auctor augue. Donec diam eros, hendrerit eget vehicula id, blandit nec urna. Maecenas eu lacus accumsan nisi tristique tincidunt. Proin euismod felis ut urna dignissim sit amet euismod diam vehicula. Proin mi mauris, sollicitudin eget interdum posuere, iaculis sed metus. Quisque congue diam id nisl cursus eu faucibus nisl luctus. Fusce eu tellus eu elit porta ultricies. Sed vel velit velit. Aliquam nec feugiat nibh. Pellentesque sit amet orci quis ligula rhoncus ultricies.</p>

<p>Donec ac rhoncus nibh. Aliquam erat volutpat. Suspendisse potenti. Donec sit amet nisi ut nunc tincidunt rutrum. Aliquam sit amet dui metus. Praesent blandit nisi non ipsum mollis feugiat. Nullam eget felis magna, vel auctor augue. Donec diam eros, hendrerit eget vehicula id, blandit nec urna. Maecenas eu lacus accumsan nisi tristique tincidunt. Proin euismod felis ut urna dignissim sit amet euismod diam vehicula. Proin mi mauris, sollicitudin eget interdum posuere, iaculis sed metus. Quisque congue diam id nisl cursus eu faucibus nisl luctus. Fusce eu tellus eu elit porta ultricies. Sed vel velit velit. Aliquam nec feugiat nibh. Pellentesque sit amet orci quis ligula rhoncus ultricies.</p>
</div>
</body>
</html>

cheers guys.
 

DHDdirect

New Member
So the client will be using a PDF print driver to create this PDF then print it?

Ages ago I've used a PHP class called FPDF to generate a PDF file. I know it may be outdated and it's a completely different direction but it may get you what you want.
 

Phreaddee

Super Moderator
Staff member
Hmmm, ill check that out but unsure whether it'll do the trick.

The project brief is as follows.
The client has sent to 500 recipients a paper survey which they fill out and mail back.
When she recieves them she inputs the data into an application ive built.
This then via the print stylesheet outputs a tailor made, print quality, custom newsletter which she prints to pdf (via acrobat pro) however the print output only looks good in safari.
Once she has received enough surveys she'll combine them and send it to the printers, along with a suppliment survey and the process begins all over again.
The content of each newsletter is dependant on the initial results, so theoretically all 500 recipients could have their own unique newsletter. This so far, despite being a massive headf**k, has been managable, but the output requires the content to be positioned in multicolumns, its so annoying because IN safari the multicols work fine, just not when sent to the pdf. Whilst firefox manages to do the multicols, it cant seem to handle the rest of the layout, and the text isnt of a high enough quality anyway...
 

DHDdirect

New Member
This may sound stupid but have you set the print quality for the acrobat print driver.

This information is from Adobe. It's for Acrobat 6 though.. I'll see if I can find a newer one.
 

Phreaddee

Super Moderator
Staff member
figured it, going to run with firefox.

feel like a bit of a douchebag for not knowing this but in firefox when you save as pdf, it overrides the printer margins and uses its defaults.

however if you type about:config in the browser
then change all print margins in there down to 0 then it displays correctly
:p
 
Top