473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Using "Prince" For XHTML/CSS Printing

Hi there

We've found a fantastic solution for generating PDF documents with fairly
complex XHTML and CSS. It does a great job (on all our tests so far...)

It's called "Prince" ( http://www.princexml.com/overview/ ) and the only
thing holding me back is the server license fee - US $3,800.

Has anyone used Prince? How do you like it? Worth the money spent?

Alternatively, has anyone here had any success in printing CSS-styled XHTML
to a PDF using any other (cheaper) method?

I've used FPDF and other server-language-based PDF solutions, but ideally
what I'm looking for is something to take *generated* XHTML files (and the
corresponding CSS) to produce PDF documents properly styled, up to CSS 2
spec.

Any thoughts/opinions?

Jun 18 '07 #1
8 3265
On 18 Jun, 17:57, Good Man <h...@letsgo.comwrote:
Alternatively, has anyone here had any success in printing CSS-styled XHTML
to a PDF using any other (cheaper) method?
No, that's impossible (for commercially practical purposes). However
if you can get in a step earlier and create XSL:FO instead of XHTML
+CSS (this is often very easy), then you can use Apache FOP to go from
XSL:FO to PDF.

I've no doubt the first step is solvable, as it's equivalent to
writing that part of a browser that evaluates CSS selectors and
applies rules to HTML elements. However in every practical case I've
needed to do this, I've found it easier to go a step earlier in the
CMS process and bind the CSS rules to the document elements directly
(this is the biggest difference between XHTML and XSL:FO).

Jun 18 '07 #2
Good Man wrote:
I've used FPDF and other server-language-based PDF solutions, but ideally
what I'm looking for is something to take *generated* XHTML files (and the
corresponding CSS) to produce PDF documents properly styled, up to CSS 2
spec.
You might want to post your question to comp.text.pdf.
Jun 18 '07 #3
Scott Bryce <sb****@scottbryce.comwrote in
news:TL******************************@comcast.com:
Good Man wrote:
>I've used FPDF and other server-language-based PDF solutions, but
ideally what I'm looking for is something to take *generated* XHTML
files (and the corresponding CSS) to produce PDF documents properly
styled, up to CSS 2 spec.

You might want to post your question to comp.text.pdf.
Thanks for the heads up!
Jun 18 '07 #4
Andy Dingley <di*****@codesmiths.comwrote in
news:11**********************@x35g2000prf.googlegr oups.com:
On 18 Jun, 17:57, Good Man <h...@letsgo.comwrote:
>Alternatively, has anyone here had any success in printing CSS-styled
XHTML to a PDF using any other (cheaper) method?

No, that's impossible (for commercially practical purposes). However
if you can get in a step earlier and create XSL:FO instead of XHTML
+CSS (this is often very easy), then you can use Apache FOP to go from
XSL:FO to PDF.
Thanks for the suggestions. I've found this site to help me along the way
if i go with this:

http://www.re.be/css2xslfo/

I can't help but feel a bit down on learning a new language to do what I
want to do... also, for some reason, XSLT seems like a step backwards in
2007, though im not sure that is accurate.

Thanks for the tips though.

Jun 18 '07 #5
Scripsit Andy Dingley:
On 18 Jun, 17:57, Good Man <h...@letsgo.comwrote:
>Alternatively, has anyone here had any success in printing
CSS-styled XHTML to a PDF using any other (cheaper) method?

No, that's impossible (for commercially practical purposes).
It depends (on the meaning of "that" and "practical", among other things).

I can view an HTML page (well, even XHTML, though that's pointless), with or
without a stylesheet, in a browser, then print it on a virtual printer,
which is actually a PDF file. I need software for that, but nice software
(both free software and affordable commercial software) is available for
that, e.g. PDFCreator and CutePDF.

I can't do batch processing of HTML pages that way, but neither do I want to
do that. If I do PDF, I want to check the result, and I may wish to make
some corrections before having it published or distributed.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 18 '07 #6
"Jukka K. Korpela" <jk******@cs.tut.fiwrote in
news:zA********************@reader1.news.saunalaht i.fi:
Scripsit Andy Dingley:
>On 18 Jun, 17:57, Good Man <h...@letsgo.comwrote:
>>Alternatively, has anyone here had any success in printing
CSS-styled XHTML to a PDF using any other (cheaper) method?

No, that's impossible (for commercially practical purposes).

It depends (on the meaning of "that" and "practical", among other
things).
Just to jump in, that "Prince" product to which I referred does EXACTLY
this - send it valid XHTML, valid CSS and it will give back a PDF. It runs
on a server.

And the goal is to use these PDFs in commercial life... we're generating
fancy looking charts via PHP (ie: each one is customized), and the
resulting XHTML is quite lovely to look at via a browser and CSS.

We'd like to make this lovely chart a PDF without writing new code to do
it.
Jun 18 '07 #7
Mon, 18 Jun 2007 11:57:04 -0500 from Good Man <he***@letsgo.com>:
Alternatively, has anyone here had any success in printing CSS-styled XHTML
to a PDF using any other (cheaper) method?
CutePDF seems to work for me. You install it as a printer driver, and
then you can print *anything* to PDF.

Price: zero

Location: http://www.cutepdf.com/Products/CutePDF/writer.asp

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Jun 19 '07 #8
On 18 Jun, 21:06, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
I can view an HTML page (well, even XHTML, though that's pointless),
XHTML certainly isn't pointless here, because we're nowhere near the
Web as yet and so the practical restrictions on using it there don't
yet apply. As an internal format that works well with XML-based tools
(or that allows embedded namespaces), XHTML has a lot to commend it
here.

>in a browser, then print it on a virtual printer,
which is actually a PDF file. I need software for that, but nice software
(both free software and affordable commercial software) is available for
that, e.g. PDFCreator and CutePDF.
I don't know CutePDF, but I use PDFCreator a lot. I particularly like
it because it generates line-art diagrams in PDFs that are still
vector art rather than flattened to a bitmap (so they're a small
filesize and they're also still scalable).

However these "virtual printer" tools still can't transform HTML
directly, they also need a rendering engine (such as Gecko or a
packaged browser). I've not found a good batch-friendly solution to
this. Perhaps that's because I've not looked that hard -- I've always
been fortunate in being able to access an earlier stage of the process
and produce XSL:FO, which is then easier to render.

I can't do batch processing of HTML pages that way, but neither do I want to
do that. If I do PDF, I want to check the result, and I may wish to make
some corrections before having it published or distributed.
I automatically publish about 20 of these a day (database
documentation), of which typically 2 or 3 change per week. I want a
technically reliable process, but I can live with some editorial
issues.

Jun 19 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mscir | last post by:
+--------------------------------------------------------------------+ | Printing XML: Why CSS Is Better than XSL | | from the anything-you-can-do-i-can-do-better dept. ...
24
by: hjbortol | last post by:
Hi! Is the expression "a >= b" equivalent to "a - b >= 0" in C/C++? Is this equivalence an IEEE/ANSI rule? Or is this machine/compiler dependent? Any references are welcome! Thanks in...
3
by: Prince Kumar | last post by:
Is there any way I can define an Unique constraint or unique index which allows more than one null values for the same column combination in DB2? ie, If my index is defined on (col3, col4) where...
3
by: Prince Kumar | last post by:
When running LOAD with "ALLOW READ ACCESS", I get the following error if select is running againt the table (isolation UR). load.sql --------- db2 load from /u02/data/dly_d040817_test.dat of...
5
by: Prince Kumar | last post by:
I am trying to escape the special characters while executing the following sql, but couldn't figure out a way. db2_all "db2 connect to mydb; db2 select * from table (SNAPSHOT_CONTAINER ( '' , -1...
11
by: tigervamp | last post by:
I purchased "Pointers on C" online and just received the book. The pages look like they have been poorly photocopied, not the quality I would expect from a $73 book. My question is, to those that...
2
by: prince -=nore=- | last post by:
I have a page, where I'm retrieving a file location from a database and outputting it's contents (HTML) onto a web page. On the aspx page, I have referred to the code behind it using the line...
17
by: William Pursell | last post by:
I debated whether this belongs in comp.lang.c++, and finally decided that it belongs here, because it really is a C question... Suppose I have a perfectly friendly, harmless library, libfoo,...
10
by: Divya | last post by:
I want to use indent to selectively format some code anomalies. For example, braces after if, etc. But, when I use the indent progam with - bl option, it does other things as well and changes the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.