Answers.Body: <p>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.</p>
  
  <p>You can either a) install <a href="http://wkhtmltopdf.org/">wkhtmltopdf</a> and tell CiviCRM to find it (<em>Administer menu > System Settings > Misc</em>), or b) increase the amount of memory available to PHP in your php.ini.  I recommend the first option!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-21T16:49:37.137Z
Answers.Text: 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.
Answers.UserDisplayName: GrannyKat
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-21T20:01:22.560Z
Answers.Text: @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.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-21T03:17:36.543Z
Answers.LastActivityDate: 2015-05-21T03:17:36.543Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>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."</p>
  
  <p>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 <a href="https://stackoverflow.com/questions/1248952/php-5-disable-strict-standards-error">here</a> and <a href="http://php.net/manual/en/function.error-reporting.php" rel="nofollow noreferrer">here</a>.  Suppress the strict notice, and the "can't send PDF file" message will go away.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-21T03:18:52.820Z
Answers.LastActivityDate: 2015-05-21T03:18:52.820Z
Answers.LastEditDate: 2017-05-23T12:38:59.763Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I will examine the lines of code mentioned, but I hope that someone can quickly identify the issues. </p>
  
  <p>Thanks, 
  Kate</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-11T14:59:03.387Z
Comments.Text: Thanks to all who answered. I hope our host will work with one of the possibilities.
Comments.UserDisplayName: Marilyn Schiffman
Tags: <civimember><message-templates>
Title: Error when printing PDF letter or mailing label from search results list
ThreadText: # Error when printing PDF letter or mailing label from search results list
  
  (Asked by: username_0 on 2015-05-20)
  
  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
  
  **Tags:** civimember, message-templates
  
  > **Comments:**
  > **username_1**: Thanks to all who answered. I hope our host will work with one of the possibilities.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-05-21. Score: 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](http://wkhtmltopdf.org/) 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!
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_2**: @username_0 - 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.  
  
  ---
  
  ### Answer by username_2 on 2015-05-21. Score: 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](https://stackoverflow.com/questions/1248952/php-5-disable-strict-standards-error) and [here](http://php.net/manual/en/function.error-reporting.php). Suppress the strict notice, and the "can't send PDF file" message will go away.
  
  
  ---
  
  