#103094 - sgeos - Tue Sep 19, 2006 5:34 am
Is there a free and easy way to convert XML to PDF? I need to convert 10,000 XML files to PDF for a CD release.
The current plan is:
nothing --(C-program)--> raw-XML --(perl)--> preprocessed-XML --(XSL)--> XSL-FO --(FOP)--> PDF
Free, but not exactly easy. =)
XSL-FO is a horriblely unfriendly language. =)
FOP also seems to be a little lacking.
-Brendan
#103097 - tepples - Tue Sep 19, 2006 5:46 am
Instead of XSL-FO, you can use Cascading Style Sheets to style your XML.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#103112 - keldon - Tue Sep 19, 2006 9:56 am
Well you can use XSLto transform your XML into XHTML or CSS to format the output of the XML - providing the XML files all follow the same DTD. There are plenty of free virtual drivers that will output pdf's while acting as a printer in your computer.
So what exactly are you starting off with? Because if it's not XML then you can put it into 10'000 HTML files and then print it to a virtual driver.
#103119 - sgeos - Tue Sep 19, 2006 10:30 am
keldon wrote: |
Well you can use XSLto transform your XML into XHTML or CSS to format the output of the XML - providing the XML files all follow the same DTD. |
The problem with CSS is that background colors and images don't print by default. CSS was not implemented with printers in mind. I need an idiot friendly solution that can print color and background images by default. I've tried CSS and the result is not acceptable.
Quote: |
There are plenty of free virtual drivers that will output pdf's while acting as a printer in your computer. |
Can this be done from the command line? I'm not going to click print 10,000 times. 20,000 actually. I need printable color and black and white versions of the files. 'Print in black and white' will not work, although processing the data twice is not a big deal.
Quote: |
So what exactly are you starting off with? Because if it's not XML then you can put it into 10'000 HTML files and then print it to a virtual driver. |
I currently have XML with an XSL stylesheet applied to it. That gives me XHTML. CSS is applied to the XHTML. This is not idiot printer friendly, so I need something else. If I can somehow run that through a batch pdf printer I'll be really happy. If not, the current plan is to write data filters, and use... *dramatic lightning* ...XSL-FO.
-Brendan
#103123 - keldon - Tue Sep 19, 2006 11:45 am
Adobe Acrobat can take a HTML with CSS and output pdf files. It can also take multiple HTML files and turn them into a single pdf file (if you wanted that), and I'm sure that their 30 day trial has full features. Although its implementation of CSS isn't the best, although I'm sure that if you did use it that you can find the something that it will do properly.
It also has a batch processing mode aswell. If this is something that you wanted to do on a regular basis, then I guess the trial would only help you fow a month.
But ...
http://www.verypdf.com/pdfcamp/html-to-pdf-converter.html
http://www.digitaljunkies.ca/dompdf/about.php
EDIT: And I have found one TOTALLY FREE pdf editing package that compiles to PDF. Only problem is that the first file I tried was faulty and the page came out a little wrong, but open office does it properly. And if it still has its HTML creator on it then maybe OO could do it.
#103135 - tepples - Tue Sep 19, 2006 2:50 pm
sgeos wrote: |
keldon wrote: | Well you can use XSLto transform your XML into XHTML or CSS to format the output of the XML - providing the XML files all follow the same DTD. |
The problem with CSS is that background colors and images don't print by default. CSS was not implemented with printers in mind. |
Use @media print. If Mozilla Firefox fails to render background colors in @media print, then Mozilla Firefox has a bug.
There exist other XML+CSS to PDF solutions. One is called Prince, but it is proprietary and costs money. Why is your organization unwilling to spend money?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#103148 - sgeos - Tue Sep 19, 2006 4:17 pm
tepples wrote: |
Use @media print. If Mozilla Firefox fails to render background colors in @media print, then Mozilla Firefox has a bug. |
That is not a bug, it is a feature. All standard browsers fail to print backgrounds by default to save ink. My last job was at a web company, and CSS's printer unfriendlyness caused hours and hours of headaches.
You can get around this by changing the browser settings, but that is not idiot friendly solution.
tepples wrote: |
There exist other XML+CSS to PDF solutions. One is called Prince, but it is proprietary and costs money. |
I noticed prince. I'm using css2fop right now, but either it or fop has a limited feature set. Background colors are not showing up.
tepples wrote: |
Why is your organization unwilling to spend money? |
Because the money is coming out of my pocket. The Adobe video bundle is expensive and more than likely necessary for what I want to do. If I need to make an $80 purchase or whatnot, I'll do it. I don't have hundreds of dollars to spend on everything I want.
-Brendan
#103174 - keldon - Tue Sep 19, 2006 7:18 pm
Background colours showed up with adobe, and the other one I showed appeared to; and they were all free. I did spot a few shareware/pay for ones that were around $80-120, but I suspect that they will do just what the free ones do. Having said that I didn't test any of them.
#103232 - sgeos - Wed Sep 20, 2006 3:46 am
The HTML to PDF converter looks absolutely fantastic. I reviewed its features but have yet to try it out. I plan to try to automate open office today. (As a bonus, if I use OO I won't need MS Office. =)
Thanks for all the info!
-Brendan