[drupal-docs] generating Drupal Handbook pdf's manually
Stefan Nagtegaal
Drupal-Docs at iStyledThis.nl
Wed Apr 20 20:56:32 UTC 2005
Op 20-apr-05 om 20:57 heeft bryan on the web het volgende geschreven:
> It seems to me that is might make more sense in the long run to build
> Server-Side PDF generation into the book module using PHP. There is a
> costly PDF library for PHP called PDFlib
> (http://www.pdflib.com/index.html). But there are also some open/free
> ways to create PDFs with PHP:
>
> FPDF
> http://www.fpdf.org/
>
> PDF4PHP
> http://www.gnuvox.com/pdf4php/
>
> Does anyone have experience with these tools. I suspect we could use
> them in the same way that the image.module uses imagemagick. I know
> this is a little off topic for the documentation discussion, but our
> documentations needs seem to be continually drifting towards a
> discussion of our documentation toolset.
>
> bryan
When the PDF is there, created and well we can also provide the whole
manual as images, simply by using ImageMagick. (For people who do not
like to download a separate PDF-viewer?)
We can do this by the following code snippet:
<?php
// Point to the handbook in PDF-format
$handbook = "downloads/drupal-handbook.pdf";
// Set the path to convert
$convert = "usr/bin/convert";
return exec("$convert $handbook drupal-handbook-pdf.jpg";
?>
For example, this would create drupal-handbook-pdf.jpg-00..01--
(increasing by the number for the pages in the PDF).
I'm not sure it's usable though, but I thought it was better to share
than to say nothing... :-)
Stefan
More information about the drupal-docs
mailing list