I'm trying to print a page with a custom view (block). I have successfully added the

line into my print.tpl.php. However, when I attempt to print this page, I get:

TCPDF error: Wrong page number on setPage() function.

and the logs contain:

# warning: Division by zero in /home/tactusca/public_html/intranet/sites/all/modules/print/tcpdf/tcpdf.php on line 8965.
# warning: array_push() [function.array-push]: First argument should be an array in /home/tactusca/public_html/intranet/sites/all/modules/print/tcpdf/tcpdf.php on line 9012.
# warning: array_push() [function.array-push]: First argument should be an array in /home/tactusca/public_html/intranet/sites/all/modules/print/tcpdf/tcpdf.php on line 8729.

Any idea what may be wrong here ?

Thanks !
Stefan

CommentFileSizeAuthor
#3 upcoming.html_.gz2.14 KBstefan_seefeld
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

TCPDF is a nightmare when placing stuff in the footer. After rc9, I did a few fixes which even remove any possible footer blocks from the TCPDF page to try to simplify stuff.

I will need to have the contents of the printer-friendly version of the page you're trying to transform into a PDF to undertand the problem.

João

stefan_seefeld’s picture

Status: Postponed (maintainer needs more info) » Active

Thusly attached. Thanks !

stefan_seefeld’s picture

FileSize
2.14 KB

Sorry, that doesn't appear to have worked. Here it is again.

stefan_seefeld’s picture

Priority: Normal » Critical

Raising this issue to 'critical' as more and more users of my site run into this bug.

Thanks,
Stefan

jcnventura’s picture

Status: Active » Closed (won't fix)

Hi,

After analyzing the file you provided, I have concluded that the problem is TCPDF's lack of support for divs inside tables. There is nothing I can do, except to recommend that you try dompdf instead.. Of course, then you won't get Unicode characters support, so I think you're in a catch-22 where you can't use any of the two libraries.

Feel free to submit a bug report in TCPDF's bug tracker.

João

stefan_seefeld’s picture

Status: Closed (won't fix) » Active

Joao,

can you provide some more specifics as to what HTML will result in the tcpdf failure ?

I downloaded tcpdf, modified an example to include a table with a div element in a td, and all seems to work fine, so I'm not sure what the failure is.

Thanks,
Stefan

jcnventura’s picture

Hi,

Actually it's my fault.. The support for divs in TCPDF used to be so bad that I was doing some stuff to make it look good that broke support for divs inside tables..

I will try to fix it soon.

João

stefan_seefeld’s picture

OK, thanks, that's much appreciated.

jcnventura’s picture

Status: Active » Fixed

Hi,

I just committed some code that doesn't break the TCPDF when divs are inside tables.. The next dev to be built should be OK.

João

stefan_seefeld’s picture

Great, thanks !
Do you have any plans to do another (non-dev) release anytime soon ?

jcnventura’s picture

Hi,

It's only been a week since I have released 6.x-1.0, so I will possibly wait around 2 weeks more to see if anyone reports any other errors.. In the meantime, I have to find some time to also add some of the postponed stuff into 1.1.

João

Anonymous’s picture

Status: Fixed » Closed (fixed)

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