Hi,

I'm am almost ready with a module that should generate some pdf labels. For now i was using a free pdf class (because i was used to it) from http://www.ros.co.nz/pdf/ . Now before comitting this module i want to rewrite it so that i only use pdf function calls from the API (see drupaldocs).

To my disappointment, this means that a pdf extension ala clibpdf must be installed on your system. This is not standard in a php distribution.
Therefor i would like to suggest that the two or so classes from the site i mentioned should be included into drupal. That way, every developper could use it. (I'm thinking about pdfview module, e.g, or handbook). The code is free, so it is no problem to include it.

If there is a way to include the classes as modules, that would do also, but i don't see how that can happen, as of course there are no hooks implemented.

I would like to not need the classes included in my module, as those are much to generic and useful for others.

Any suggestions are welcome. which way should we go?

In some other node i found a discussion concerning the fonts. There was a 'quick' hack from Steven on fpdf (IIRC) to support UTF8. But no further work seems to be done on that part. Wouldn't it be useful to have one of the free pdf classes available to modules, even if the encoding support is not really there yet?

thx for your input...

luksedj

Comments

sly_ece’s picture

Let me know when it is ready and I will help test it, particularly interested in the Drupal Book page type to PDF functionality.

pieterdt’s picture

Thx for your interest, but my post is intended to start discussion about which way to go with pdf support in drupal. We need to agree on this before any implementation can be done.

luksedj

laird’s picture

I'm interested in generating PDF's from Drupal books, and it seems like there are several ways to tackle this, none of which appear current and complete. Am I missing something? This seems like a rather nice feature for Drupal, and I'm surprised to see it is such an unclear state.

If you've got a module ready to submit, please do so. At least for me, I'd have no problem installing clibpdf (or any other library required).

- Laird Popkin

pieterdt’s picture

My module will only generate labels in pdf. (like a merge document in word or excel). The module does not provide any pdf support, that is what i was looking for.

If you have installed clibpdf or something, you can use the pdf api (search http://www.drupaldocs.org for pdf) to get things going.

What you say is true, there seems to be no well defined way to go for drupal & pdf. There are several reasons:

  • policy of not inlcuding third party code into drupal
  • Bad (hard to implement correctly) UTF-8 encoding support in pdf spec
  • ...

I discussed to pre-package some pdf classes in drupal on #drupal but for the mentioned reasons there seems to be no interest from the core developpers.

I came accross some classes recently that says to support UTF-8 (lost the link however) on sourceforge. It only works with PHP5, so haven't tried it yet. But it can be interesting.

anthonymeagher’s picture

Wordpress have developed a plugin (module) in PHP : WP2PDF lets you convert a blog entry (or different entries and even all entries) to a PDF - website is:
http://wp2pdf.sourceforge.net
Might be of interest it works well! Not sure about labels, but converts Wordpress 'pages' to multipage PDF.

Also, need to check this, but isn't there an FPDF module for PHP? It's being around for a while and so should be very stable.

Anthony

sepeck’s picture

Work on improved out put capabiliites for the book module was needed before automatic pdf generation. puregin has been working on that for 4.7. Once that is done, I suspect an additional module for nice output pdf generation will be much easier.

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide