HTML to PDF
April 21, 2013 9:18 AM   Subscribe

Help me turn a photo essay, currently in HTML, into a PDF (without big ugly white space when photos break to the following page).

This is very simple: a series of center-aligned photos (not enlargeable) interspersed with bits of center-aligned text, sort of like a film strip. It's long...probably will be a 20 page PDF.

I want to convert to PDF as painlessly and cheaply as possible. When I create a PDF via Safari, it's got lots of white space, where a given photo won't cram into the page.

What's my best bet here? I am on a Mac. And I'm willing to jigger the photo sizes if necessary.

Tell me I don't need to buy Acrobat....
posted by Quisp Lover to Computers & Internet (8 answers total) 1 user marked this as a favorite
 
Best answer: I'd write a CSS for print stylesheet. Probably force the images to a consistent height, and wrap the image + caption in a div that's got a consistent height so that page breaks are predictable.
posted by adamrice at 9:25 AM on April 21, 2013


Best answer: For HTML to PDF where I actually care about how the result looks, I usually open the HTML in LibreOffice Writer and jigger it about by hand before doing an "Export as PDF". It sounds a bit laborious but doesn't generally take too long.

You might also consider printing to PDF from Firefox, using the Print Edit add-on to tidy things up.
posted by pont at 9:27 AM on April 21, 2013 [2 favorites]


Best answer: If you're looking to get the pagination right, the best option will usually be to convert via a wordprocessor. Once you've tweaked the layout and got it looking the way you want it, the resulting PDF should be pretty much a perfect rendering of the document. Monkeying about with CSS and then hoping the browser will produce something pleasing sounds like an exercise in frustration.
posted by pipeski at 10:04 AM on April 21, 2013


Best answer: If you're using Firefox, you can also use the Nuke Anything Enhanced add-on to "edit" pages before printing by right-clicking and selectively removing divs and other objects on the page, which might help with the cleanup as well!
posted by limeonaire at 10:57 AM on April 21, 2013 [1 favorite]


Best answer: wkpdf is a command line utility on the Mac that I've used quite successfully to create PDF documents. Try it out.
posted by DreamerFi at 11:04 AM on April 21, 2013


Best answer: I'm not sure what its relationship to wkpdf is, but there is also wkhtmltopdf.
posted by Dr Dracator at 2:48 PM on April 21, 2013


How are you creating the PDF via safari? You can often hit "print" on a webpage, and then instead of printing it to an actual printer, print it to PDF. Dunno if that's what you tried, but it must be by far the easiest, so I'd suggest tinkering with a few browsers and settings.
posted by Buckt at 4:04 PM on April 21, 2013


What Buckt said. If you're on a Mac File > Print... > PDF Button > Save as PDF.

In chrome you have to escape the crome window and "Use OS Dialog".
posted by humboldt32 at 6:54 PM on April 21, 2013


« Older Personalized book recommendations, please   |   Seeking recommendations for films about Jewish art... Newer »
This thread is closed to new comments.