Austin Ziegler
2/13/2005 3:34:00 PM
> [a Ruby pdf writer that supports images]
> ----------------------------------------
> Artotoy has a website that produces invoices as PDFs, using PDF::Writer,
> but recently discovered that PDF::Writer seemed not to have support for
> images.
>
> Dan Fitzpatrick said that he was working on porting the PHP FPDF library
> to Ruby. It was working for simple cases but needed a few weeks to work
> out the bugs and add more advanced features.
>
> Fredrik Jagenheim pointed out that the CVS version of PDF::Writer did have
> support for images, through a method add_jpeg_from_file. The library's
> author, Austin Ziegler, just hasn't got around to releasing a new version
> yet.
To make my current work a bit more prominent (I think it's buried in a
couple of other messages): I am working on PDF::Writer again and will
be making a release soon after upgrading a *lot* of functionality,
fixing numerous bugs, and (most importantly) making the API much more
Ruby-friendly.
I am currently working with the image support and have abstrascted it
out such that instead of #add_jpeg_from_file, you will have
#add_image_from _file -- which supports either JPEG or PNG. I'm not
sure that the PNG transparency support is going to be as solid as it
should be, because I'm pretty sure that there's a few bugs in the
code, and although it appears to support alpha channel or greyscale
transparency, that information is never inserted into the resulting
PDF the way that palette transparency is inserted.
I have heavily modified the ImageSize library to support obtaining
additional information from JPEG images so that PDF::Writer can
support JPEG images in CMYK colourspace. This means that, once I get a
bit of other stuff done, PDF::Writer *will* be able to be used for
pre-press PDF work (including the markers).
The API changes will be mildly painful to existing users, but I have
attempted to keep the argument count and meaning for the new calls the
same as the old calls, and I have made wrapper functions that warn
that the API in question is going to be deprecated.
The biggest change that should make it into the code which will not
make it in this iteration, I think, will be a change and
simplification to the table code.
I have houseguests for the week, so I will not be able to get nearly
as much time on this as I would like, but I would look for a release
of PDF::Writer 0.7.0 (or higher) toward the end of the month.
-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca