I've attached a mailing label display to a display that has the same fields and filters, and I am using exposed filters so I've set 'use exposed arguments' to true,
but when I click on 'Print PDF', my browser spins for 5 seconds or so and then nothing happens. I've tried this with both the alpha2 version and the dev version, and used both Firefox and Google Chrome browsers without any difference in results. I've got my popup blocker turned off.
Any idea how I can troubleshoot this? I can confirm that the mailing_label_create_label function is being called but I don't know how to find out why the PDF file doesn't show up.
Comments
Comment #1
acouch commentedthis weekend i plan on building in some test elements to help troubleshoot these cases. I still haven't been able to reproduce this locally so am not sure what the problem is.
Comment #2
acouch commentedcan you tell what you get when you 1) turn on devel module 2) try and create a label and 3) got to http://yoursite.com/devel/variable/edit/mailing_label_results ?
Comment #3
darrellduane commentedThanks for looking into this.
I get Old Value:
Array
(
[0] => Array
(
[field_student_fname_value] => First Name
[field_student_mname_value] => Middle Name
[field_student_lname_value] => Last Name
[address] =>
210 15th St nw
Washington, DC, 20010
)
[1] => Array
(
[field_student_fname_value] => First Name
[field_student_mname_value] => Middle Name
[field_student_lname_value] => Last Name
[address] =>
)
[2] => Array
(
[field_student_fname_value] => First Name
[field_student_mname_value] => Middle Name
[field_student_lname_value] => Last Name
[address] =>
123 Main St
Fairfax, VA, 22033
)
)
New value: Sorry, complex variable types may not be edited yet. Use the Execute PHP block and the variable_set() function.
Let me know what else I can check.
Comment #4
darrellduane commentedOk, we found the problem.
It turns out that we need to add a call to
exit;
on line 106 of mailing_label.module, right after $pdf->Output( 'label_' . $format . '.pdf', 'D' );
in the mailing_label_create_label function in mailing_label.module.
This is done according the caveat at the bottom of the page on:
http://www.fpdf.org/en/tutorial/tuto1.htm
We used the Live Headers plugin to see that there was extra garbage coming from someplace that stopped the pdf from being generated.
Now we get some nice PDFs with mailing labels on them! Let me know if you need a patchfile.
Comment #5
acouch commentedwow. thanks so much for troubleshooting that. this is what rocks about drupal. i'm surprised that the fpdf didn't give you an error message. i will include that in the dev and next version.
Comment #6
acouch commentedmarking as closed.