CMS data to pdf?
- Started
- Last post
- 11 Responses
- citizen_h
Any folks out there had experience with this.
Looking to use data inputted into a CMS which then exports a high res pdf ready for print. So with printers marks added as well. I know this can be done quite simply but not sure about high res pdf with printer marks. Any advice much appreciated cheers :-)
- vaxorcist0
this can be done, but there are potential issues...
1. What sort of CMS are you using? Does it store data in mySQL? Does it use PHP or similar scripting language?
2. We did something like this in the past and had one HUGE issue, on the web, text can expand easily, on a print layout, text is generally pretty locked in, so we had to script lots of exceptions into our PDF-template layout, rather than just saying HEADLINE goes here, SUBHEAD here,etc...
3. the images for a print hi-res PDF are usually much higher res/filesize than on a web CMS, so you may have to modify your CMS to have 2 image files per image, one low-res, one hi-res...
4. there's no 'out of the box' solution I can think of, there may be somebody who has done this .... I'd be curious if somebody has developed a wordpress or similar template with PDF export.... it possible, but it helps a TON to have your print layout in mind BEFORE you fill up your web content, not after....
6. this can be the sort of "magical thinking" that some business-guy may be thinking you can whip out during a few lunch breaks... it's not like that....
- ok many thanks for this. And you guessed correctly with number 6. :-)citizen_h
- Yeh, I've done this - a while ago, but it was persnickety. Set up a template doc that just plugged the data into.mikotondria3
- Don't forget about #5. Very important.nb
- #5 eh!vaxorcist
- vaxorcist0
ok.... there are various ways to do this....
are you using drupal?
http://drupal.org/project/printhttp://en.wikipedia.org/wiki/TCP…
(included in some CMS's)TCPDF is an open source PHP library that will take SOME html / css and make a pdf out of it, a bit of searching indicates lots of tweeking, and a heavy RAM footprint, but it looks interesting...
http://www.tcpdf.org/index.php
(also you might outsource dev work to the original TCPDF dev team if this gets crazy and your boss needs it fast....)but there are stack overflow questions like:
http://stackoverflow.com/questio…might be interesting too..
http://www.od2dev.be/choosing-th…
http://stackoverflow.com/questio…
- vaxorcist0
possibly
http://www.web2pdfconvert.com/pd…
not sure about printers marks,etc...
- lukus_W20
The best way to do this is to use http://code.google.com/p/wkhtmlt… to convert a web version of the content into a PDF. As the the toolkit makes use of webkit as the rendering engine, a lot of the newer css3 properties can be employed to ensure that your images are provided at the correct resolution. Even works with web fonts.
I've used this toolkit with the Drupal module ('print') vaxorcist mentions .. it's a nice solution (although the Drupal module tries to accomplish too many disparate tasks IMO).
I'd definitely recommend this over TCPDF which doesn't really achieve a good enough quality IMO.
- vaxorcist0
the CSS3 image size idea is very nice... could save lots of effort here....
- vaxorcist0
question... do you need this to:
1. just make a PDF that looks mostly like the web page?
or
2. take content from the CMS and put it into a precise print layout that may look more like an advertisement, poster or magazine page than a web page?
- spot130
I don't think any 'html to pdf' converter will work for high-res print. I've created dynamic / high-res PDF app for generating eReceipts for charities in the past using a .NET component, where basically you create a PDF template with dynamic text fields and then you fill it with content from a web-based form. This doesn't work well for large text areas and is best suited for text fields and the files can be huge depending on what you have in your template:
http://www.dynamicpdf.com/- checkout http://www.w3.org/TR… ,, there are new css3 tags that can helplukus_W2
- wkhtmltopdf will only create a 72dpi file, not the 300dpi or 600dpi required for printspot13
- That's not true spot13 .. you can define the DPI you output at.lukus_W2
- melq0
And, just to make things even messier, can you append the HTML to an existing .PDF? Think "added as additional pages to existing sales literature".
- create the file separately then concatenate them .. http://madebyparker.…lukus_W2
- sure, if you do it locally or very infrequently, otherwise you'd need a server farm to process the PDF'sspot13
- you just need a server - there's no need for a server farm.lukus_W2
- depends on your volumespot13
- vaxorcist0
appending some HTML to an exisitng PDF may sound like adding a bit of Guinness to a Lager beer to a business guy, but it's more like adding a gallon of Jaegermeister to a Pina Colada...
- citizen_h0
@vaxorcist
Its option 2.
Essentially to take content from the CMS and put into precise layouts like a magazine spread.
- vaxorcist0
that changes a lot...... ok.....
why? because HTML/CSS layouts are much more liquid than print layouts, unless you can make your print layout very forgiving, i.e. have a 1 or 2 or 3 line headline without messing everything else up.....
Imagine layout done in all absolute positions without knowing how long the headline text is....
You will have to write some "text-wrap-detect" code to figure out if your headlines will spill onto 2 lines or fit on one, then you set a variable and move the body text up or down by x pixels based on this...
basically, you have to script many of the little tweeks designers do by hand and eye....
Also, you might have, say 5 slightly different layout templates, for, say a vertical photo, a horizontal photo, a square photo, or one layout for a long pullquote, another for a short pullquote...etc...
get ready for tweek-o-rama, unless your CMS already has very, very precise content limits, like, say, all headlines are 72-76 characters only, all photos are square at a certain size,etc....
or, make your layout look alot like a web page and it may be easier....