When I am logged in as a user, the print to pdf works like a charm. When logged in as an anonymous user I get the following error as shown in "print_error.jpg". When I go back and click on the link a second time i get a new web browser page full of garbage as shown in "print_error_2.jpg".

Any help you can provide would be appreciated!!

CommentFileSizeAuthor
print_error_2.jpg626.04 KBtimpiche
print_error.jpg23.04 KBtimpiche

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

This is caused by the cache mechanism of Drupal caching the generated PDF. Unfortunately Drupal doesn't know how to serve a PDF from cache (wrong headers).

This was fixed a couple of months ago so any version >= 6.x-1.1 should not show this problem. Are you using an older version or using the aggressive cache mechanism?

João

timpiche’s picture

I am using the latest version (1.3) and the normal caching method. This only happened after I updated to the latest version.

jcnventura’s picture

Thanks for the info, even if they're bad news...

Let's break this down into the problems then:

1. PDF generation works, except when you're logged out.. Nothing in the module works differently when you're not logged in. If users don't have the 'access print' permission, they will get an access denied, but certainly there's no change in the PDF generation itself that would result in a 'PDF file damaged'.

2. The fact that a first click is different from the second suggests a cache mechanism at work. In my site (and I believe several others), the normal Drupal cache is not creating this problem anymore, so maybe there is some other cache at work in your site.

I see from your 2nd screenshot that you're using dompdf.. Can you try TCPDF and see if you get the same problems? The bugs in dompdf are many and there's no one trying to solve them, and you may have stumbled in one of them.

Other than that, I am baffled by by this behaviour.

João

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No info received in two weeks. Closing the issue.

halcyonCorsair’s picture

Status: Closed (fixed) » Active

Hi, I experienced the same issue when using the boost module for caching. Disabling the boost module for print/* and printpdf/* pages worked for me.

I was using print-6.x-1.10.

halcyonCorsair’s picture

Status: Active » Closed (fixed)
jyr’s picture

I have the 'access print' permission for user anonymous, but dont can create the pdf. Only works with admin, Any suggestions?