Greetings.
I am writing this post to report a small bug that is happening in the beta version of this module.
Every time I generate a pdf and perform a reload on the page appears the following warning.
Warning: Can not modify header information - headers already sent in drupal_send_headers () (line 1225 in / var / www / drupal / includes / bootstrap.inc).
This problem happens with the following scenario.
- Was installed print correctly.
- The library was installed wkhtmltopdf-amd64
The entire installation process took place normally.
The pdf is also usually generated. What happens is that it always appears Warning annoying that every time a pdf is generated.
In order to help them was behind the problem. What I found was this.
In the file print_pdf.pages.inc lines: 407, 408, 412. Runs a command to change the header of the page. Because of this Drupal generates this warning.
The big problem is that we can not run from these headers () because without them there is to generate the pdf file. Then I found a way to avoid this warning was present run this command immediately after you generate the PDF.
Enter the command flush () and return true, put it, unset ($ _SESSION);
So I force myself to avoid cleaning session and appear on the next reload the warning.
I ran a test with the function drupal_get_message ('error', true), but success in getting that call that should not be done in the same location. The only way I could do was not displayed using the unset ($ _SESSION).
I am also sending a screenshot of the problem.
Screenshot
Sorry for my english but I'm using Google translate hehehe.
If you need help I'm a Drupal developer six years and I can help fix future bugs that module.
Thank you for creating this module. Saved me a long time :-)
If you need help, call me.
[] 's
Comment | File | Size | Author |
---|---|---|---|
#1 | print_pdf_1399636.patch | 408 bytes | benys |
print_pdf.pages_.inc_.tar_.gz (Line Fix: 416) | 5.94 KB | Ferrari | |
Screenshot at 2012-01-10 10:19:39.png | 218.57 KB | Ferrari |
Comments
Comment #1
benys CreditAttribution: benys commentedfunction print_pdf_controller() should close drupal request (drupal_exit).
Comment #2
benys CreditAttribution: benys commentedComment #3
medden CreditAttribution: medden commentedI can confirm this patch fixed the reported error.
I was getting the same issue using wkhtmltopdf-11.0-i386 and the print-7.x.dev and 7.x.beta releases.
Comment #4
hanoii+1, it fixed it on dompdf as well!
Comment #5
Jaapx CreditAttribution: Jaapx commentedThanks, #1 worked for me with wkhtmltopdf
Comment #6
bancarddata CreditAttribution: bancarddata commentedWorked for me using TCPDF
Comment #7
jcnventura CreditAttribution: jcnventura commentedThanks benys. I've committed this to git.