CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • SOLVED: Can Configure New "Print PDF" Action - But Getting Blank PDF's
Pages: [1]

Author Topic: SOLVED: Can Configure New "Print PDF" Action - But Getting Blank PDF's  (Read 923 times)

chapmanla

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 1
  • CiviCRM version: 4.3.1
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.0.95
  • PHP version: 5.2.5
SOLVED: Can Configure New "Print PDF" Action - But Getting Blank PDF's
May 17, 2010, 05:20:55 pm
This is a case of a little knowledge being a dangerous thing.

I have "successfully" added a "Print PDF Letter for Contact" action for the Find Members results form (I would like to use Find Members as opposed to Contact Search since I would like to have access to the "Renew Membership" link that is part of the Member Search form).  Selecting the Print PDF action takes you to the PDF composition page - all the message templates show up as well as all of the tokens.  The "Number of Selected Contacts" value is also correct.  When I submit using the "Make PDF Letter" button, however, I get a single blank PDF.  This process all works correctly if I print PDF's through the Contact Search results page.

My debugging skills are limited - I have not been successful in determining if the passed variables to the HTML2PDF function are correct.  

I feel like I am close to getting this to work - any help or pointers would be greatly appreciated.
« Last Edit: May 31, 2010, 10:38:13 am by chapmanla »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can Configure New "Print PDF" Action - But Getting Blank PDF's
May 29, 2010, 06:40:42 pm
Hi,

Which version are you working on? I did a patch which I think is going into 3.2 to the contribution one and I had to tweak / patch quite a few things - making membership data available to the pdf, allowing it to use html for the pdf, allowing it to send e-mails instead of pdf and quite a bit of work to handle situations where there was no contribution page id.

It might be you are better starting from the 3.2 version of the code
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

chapmanla

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 1
  • CiviCRM version: 4.3.1
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.0.95
  • PHP version: 5.2.5
SOLVED: Can Configure New "Print PDF" Action - But Getting Blank PDF's
May 31, 2010, 10:36:53 am
Thanks for your post Eileen - I recently figured out what I was missing.

I used the PDF.php and PHPLetterCommon.pdf files from CRM/Search/Form/Task as templates.  Given that these files were now in CRM/Member/Form/Task, I was missing the relevant ContactID's.  This was corrected by adding

parent::setContactIDs( )

in the preProcess( ) function in PDF.php.  I discovered this after looking closely at Email.php in Member tasks.

Everything now works fine.  I'll be glad, however, when the ability to add actions via hooks beyond contact searches is added in future releases.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • SOLVED: Can Configure New "Print PDF" Action - But Getting Blank PDF's

This forum was archived on 2017-11-26.