Is it possible to extend third-party tools list supported by print module with
mPDF (based on FPDF, HTML2FPDF, and UFPDF, with a number of enhancements)
http://mpdf.bpm1.com
documentation - http://mpdf1.com/manual/index.php
Because it supports both UTF-8 and CSS!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

powery’s picture

Version: 6.x-1.6 » 6.x-1.12

subscribe

eL’s picture

Yes, mPDF is may be the best library for PDFing...

Les Lim’s picture

Title: mPDF for print module » Add support for mPDF library
Version: 6.x-1.12 » 6.x-1.x-dev
Assigned: Leagnus » Unassigned
Status: Active » Needs review
FileSize
3.1 KB

Here's a quick implementation of the mPDF 5.0 library. As with the other PDF libraries, you'll have to download and install mPDF separately and place the unzipped mPDF directory on your server in either the print.module's lib directory or in sites/all/libraries. You also have to give write permissions to the following in the mpdf directory:

/ttfontdata/
/tmp/
/graph_cache/

All of that is documented here: http://mpdf1.com/manual/index.php?tid=452

ogi’s picture

subscribe

pearcec’s picture

sub

ts145nera’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
FileSize
3.05 KB

Hello, I try to port this patch to D7.
Needs review

jcnventura’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Postponed

Feel free to use patch this into your module.. I need to create a pluggable-PDF-library-of-the-week system so that the task of maintaining these can be handled by a sub-module author.

Once I have that, I'll evaluate this, and decide whether it should be part of the print package or not.

Murz’s picture

I try all libraries that Print module support at now, but none of them have good support for tables in many pages (and I can't find the way how to solve this problem).
So, I try mPDF library and can say that it is much better than others, it have support for multiline tables and some other features, so adding support for it into Print module will be very good.

sugreen’s picture

subscribe

leenx’s picture

sub

leenx’s picture

Version: 6.x-1.x-dev » 6.x-1.13
FileSize
3.11 KB

Updated the D6 module to cleanly apply against print 1.13.

Hope this helps other people.

Thanks

leenx’s picture

Version: 6.x-1.13 » 6.x-1.14
FileSize
3.11 KB

Basic updated patch to give mpdf support in the print module. Updated for 6.x-1.14.

Thanks

leenx’s picture

FileSize
6.24 KB

Further updated to support inline printing and e-mail.

Enjoy

icyread’s picture

yeah mPDF is the best UTF8 html to pdf library that I have ever used. Everything so straight forward and very easy to use.

leenx’s picture

Hope my patch helps. If there is any else that can be added, please suggest and I will see what I can do. The basics is working for my use at the moment.

chrislabeard’s picture

Thank you very much for this patch it has saved my skin. The only thing it seems isn't working is the filenames it looks like it only saves the NID.

Thanks

leenx’s picture

Greetings ...

Sorry, I don't totally understand your problem...

Have you tried this with the other PDF lib backends?

Can you give us an exmaple? I would like to help with this backend as much as possible.

Thanks
Mailed
LeeT

kla2t’s picture

leenx, the patch is working like a charm and helped me building multi-page tables from a product database (which no other library than mPDF could bring about). If you are seriously asking for suggestions I'd say it would be even better with an implementation of the mPDF header / footer capabilities!

leenx’s picture

kla2t, I was more wanting to better understand the problem that chrislabeard was having, but how closely does this work as expected with the TCPDF? I might be able to look at how it's done and maybe add this functionality, as time permits.

chrislabeard’s picture

I used the other pdf libraries and they all saved the file correctly with whatever syntax I specified but it seems like this one will only save the file name as the NID. However this pdf library is the best!!!

leenx’s picture

Mmm, I will build a dev system and see what I can see. It's a pity that mPDF lib does not get updated as often as tcPDF does. Give me a little time to look at this and I will report back, with hopefully a patch.

kla2t’s picture

leenx, thanks for your efforts. Actually the integration of TCPDF headers/footers into print_pdf.pages.inc by theme_print_pdf_tcpdf_header etc. works as expected - it generates repeating headers and footers on each new page in a PDF document, and it is capable of pagination.

leenx’s picture

Cool, you going to post a patch for us to play with?

jeramy’s picture

I am having problems with domPDF breaking on cross-page tables and would really like to use mPDF instead. Will any of these patches work for D7? Is there likely to be one in the future? Thank you all for your efforts.

leenx’s picture

Version: 6.x-1.14 » 6.x-1.15

Greetings ...

I have not tested the mpdf patches on D7 and I don't think they will work, would need a bit of reworking.

I do know that jcnventura has said that there is work going to be done on making the PDF lib backends more module, so that people can add their own PDF libs, but have not seen any work of late.

I don't believe that it would be too much work to get mPDF to work with print on D7. If you don't come right, let me know and I can look at in a few weeks.

Thanks
LeeT

jcnventura’s picture

Version: 6.x-1.15 » 7.x-2.x-dev
Status: Postponed » Fixed

Thanks everyone for you patience. I've committed leenx #13 patch into the 7.x-2.x branch of the module.

This was my testbed on how easy it was to add support for a new library using the new module architecture.. It passed with flying colors. Be warned thought that the 7.x-2.x branch is still unstable and shouldn't (yet) be used for production sites.

leenx’s picture

Awesome! Wonder if this is going to be back ported to Drupal6 Print?

One less patch in my build system.

jcnventura’s picture

Yes, the plan is to backport the module to D6 after I release 7.x-2.0. No guarantees on time, though :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

brad.bulger’s picture

Issue summary: View changes
FileSize
6.64 KB

attaching a 6.x version - wasn't sure if this should be in a new issue or not, but thought it might be useful to fellow laggards still on Drupal 6