3

Ran a filtered search for all "regular" members and search returned 379 records. I then wanted to create printable letters for all 379 members. I selected our New Member Welcome Letter as the template and pressed "Make PDFs". Result:

Notice: Undefined index: metric in /home/sherida1/public_html/rabbit/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/PdfFormat.php on line 309

Notice: Undefined index: metric in /home/sherida1/public_html/rabbit/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/PdfFormat.php on line 309

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home/sherida1/public_html/rabbit/administrator/components/com_civicrm/civicrm/vendor/dompdf/dompdf/include/frame.cls.php on line 180

After seeing the memory size error, I tried something simpler. Selected the first 10 names from the search result and tried "Make Mailing Label" Results:

Strict Standards: Non-static method CRM_Contact_Form_Task_Label::buildQuickForm() should not be called statically, assuming $this from incompatible context in /home/sherida1/public_html/rabbit/administrator/components/com_civicrm/civicrm/CRM/Member/Form/Task/Label.php on line 60

TCPDF ERROR: Some data has already been output, can't send PDF file

I will examine the lines of code mentioned, but I hope that someone can quickly identify the issues.

Thanks, Kate

  • Thanks to all who answered. I hope our host will work with one of the possibilities. – Marilyn Schiffman Jun 11 '15 at 14:59
5

With your first error, the issue is with TCPDF, the standard PDF library that CiviCRM ships with. TCPDF isn't very efficient, and takes a lot of memory when you try to generate a large PDF. Unfortunately, the other two PDF options have issues: DomPDF doesn't support all of the features TCPDF does. wkhtmltopdf is great, but is written in C, which means that unlike PHP applications, you need a version specific to your environment. If you install wkhtmltopdf on your server though, you can tell CiviCRM to use that instead. I think this is the best solution for you.

You can either a) install wkhtmltopdf and tell CiviCRM to find it (Administer menu > System Settings > Misc), or b) increase the amount of memory available to PHP in your php.ini. I recommend the first option!

  • Jon, extremely helpful info.I've downloaded the appropriate versions (Linux CentOS 6, as per my hosting company) and I'm starting to wade through the documentation for wkhtmltopdf. However, I'm running up against the limits of my technical knowledge and am a bit lost. Can you give me some advice on where to install. I sse the dompodf files in administrator/components/com_civicrm/CRM/vendor/dompdf. Is the vendor directory where I should upload and extract wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm? Any help will be much appreciated. – GrannyKat May 21 '15 at 16:49
  • @GrannyKat - since you're downloading a pre-compiled version, you can put it anywhere you like! I wouldn't put it in the vendor folder though - that's for stuff controlled directly by Civi. If possible I'd put it outside of the Joomla directory entirely - it can be anywhere on the server that your web user can access it. Really, just putting it on the server + telling Civi the path to it should be all you need. – Jon G - Megaphone Tech May 21 '15 at 20:01
3

Regarding your second issue: When a PDF is generated, CiviCRM can NOT put anything else on your screen before sending the PDF header. However, you're getting a "Strict Standards" notice - which comes before the PDF header. The second line of your second message is saying, "Hey, I can't create a PDF because I showed you that notice first."

Now that's not really an error - it's the most innocuous of notices! A production environment should be configured to not show strict notices. There's good advice on fixing this here and here. Suppress the strict notice, and the "can't send PDF file" message will go away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.