[cairo] PDF lib?

Carl Worth cworth at cworth.org
Thu Feb 3 05:56:26 PST 2005


On Thu, 3 Feb 2005 03:32:23 +0000, Rui Tiago Matos wrote:
> I realise that cairo is supposed to write PDF files. But what about
> reading them and display them on screen?

The cairo library itself doesn't provide this functionality directly,
but it does make it quite easy to build such a thing on top of
cairo. This keeps parsing code for many formats, (PDF, SVG, etc.),
outside of the core library which is focused on drawing.

And Alexander Larsson has an application in progress that does exactly
that. It's a port of xpdf made to render everything with cairo. It's
called xpdf-cairo and can be found in the xpdf-cairo module in CVS:

You may browse the source here:

	http://cvs.cairographics.org/xpdf-cairo/

Or check it out with a command like:

	cvs -d :pserver:anoncvs at cairographics.org:/cvs/cairo co	xpdf-cairo

I could imagine that it might be useful to have PDF rendering made
available in a library rather than just a standalone program. This
would be similar to the SVG rendering library libsvg-cairo that
already exists. Alex might have some ideas on how suitable the
xpdf-cairo code would be for such a library.

> Is cairo's goal to be a framework similar to what apple's quartz[1] is?

I do not have any goal for cairo to be like quartz. With cairo, we've
started with experience with the PostScript imaging model and our own
ideas for what kind of interface programmers will find most compelling,
and we've been building up from scratch from there.

> [1] http://developer.apple.com/documentation/GraphicsImaging/Reference/CGAPI-title.html

That said, I hadn't ever looked at that web page before, but from
reading just the opening paragraph, it's clear that cairo and quartz
share some similar goals:

	"advanced, two-dimensional drawing engine"
	"API is easy to use"
	"Bezier curves, path-based drawing, transparency,...,antialiasing"
	"PDF generation"

And there are a couple of things in that list that I recognize as
important to be enabled by cairo, but that I believe are best
implemented in other layers than libcairo:

	"advanced color management"
	"PDF playback"

I hope that helps answer some of your questions.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050203/d1719029/attachment.pgp


More information about the cairo mailing list