Graham Doel
All About : Techy


Drupal, PDFView and FPDF

By: Graham Doel, August 9th, 2005

I have been experimenting with Drupal as a content management system (this is my way of playing, some people play golf, I play with computers).

There are a few things I like about Drupal

  • It is open source so it is developed by the web community.
  • It has countless modules, which are easy to use and means you can get it to do what ever you like.
  • It has themes so changing the look and feel of the site is very easy.

One of the modules I have tried is pdfview which allows people to generate a PDF of what they are reading.

It generates the PDF file from the content that the user is reading at that moment, by generating the file from the database (Buzzword: on the fly). It uses the freely available FPDF files to achieve it.

The problem I found is that it is not particularly easy for a non programmer like me to modify the output of the PDF file. The set of files that comes with it doesn’t generate a line break between the paragraphs.

Matt was round for his lunch and I picked his brain about it and he explained that there was a line missing in the module.pdfview file.

If you add

      $pdf->Ln(5);

After line 89 it works fine. Which I thought was good news. So if you are struggling with line breaks in PDFView that is all you need to do. Alternatively you can just download my hacked copy!

Read "Drupal, PDFView and FPDF" in full. This post is filed in "Computers",

3 Responses to “Drupal, PDFView and FPDF”

  1. Boris Mann Says:

    Hi Graham — great to hear you are experimenting with Drupal. The best way to contribute fixes back is to go to the issues page for PDFview and post a followup — then everyone gets the benefit of your hacking.

    Thanks!

  2. Graham Doel Says:

    Thanks Boris, I have done that. I’m not used to contributing to this kind of project. Matt did the work.

  3. Matt Fletcher Says:

    (blush)

    When you’ve spent days staring at FPDF code, things like this come easily!

    Sorry Graham, but I’m going to hijack your blog to announce that mine is crawling slowly back to life!

Leave a Reply

Previous in category : Cheap, legal MP3 music downloads

Next in category : Online Video’s