[clue-tech] Solution for converting complex XHTML to PDF?

Dan Harris dan at drivefaster.net
Thu May 10 22:07:09 MDT 2007


Greg Knaddison - GVS wrote:
> On 5/10/07, Dan Harris <dan at drivefaster.net> wrote:
>> I'm working on a project that needs to convert many complex XHTML 
>> documents with
>> heavy use of images, tables and CSS to PDF.  This needs to run in a 
>> completely
>> automated fashion.  I have looked at XSL-FOP and HTMLDoc but both have
>> limitations that don't meet the requirements at hand.  XSL-FOP doesn't
>> understand CSS and HTMLDoc has very limited support for CSS, and at 
>> that, only
>> in the latest development version.
> 
> Agreed - in my last review of those tools they came up short for the
> task you describe.
> 
>>
>> In order to accomplish this, I'm wondering if it might be possible to 
>> manipulate
>> Firefox or KHTML via some fancy API calls to print a document to 
>> postscript,
>> then call ps2pdf on the resulting file.  I have been googling for a 
>> while trying
>> to find resources on how to accomplish this, but I'm not finding 
>> anything that
>> fits my parameters.  Maybe this isn't possible?
>>
>> Anyone done this before or have a recommended tool for accomplishing 
>> this?
>>
> 
> I haven't done it - but I do believe that the Pearl Crescent Page
> Saver can do scripted creation of png.  png2pdf should be relatively
> easy.  Right?
> 
> https://pearlcrescent.com/products/pagesaver/
> and
> http://png2pdf.sourceforge.net/

Thanks for those links.. Do you know if Pagesaver actually paginates the output? 
  It looks to me like it just makes a single image for the whole browser 
viewport.  However, when we're dealing with 30-40 pages of output, a single 
"page" in the pdf would pose some navigational difficulties.

-Dan



More information about the clue-tech mailing list