Answers.Body: <p>No custom code required! If you're on Drupal Views integration, which ships with CiviCRM - all that's required here are Drupal modules Views, Views PDF and installation of two libraries for the PDF generation: tcpdf and fpdi;</p>
  
  <p><strong>Here are the steps:</strong></p>
  
  <ol>
  <li><strong>First we will create a Membership tab</strong> in your Drupal <code>/user</code> screen where we will display the relevant Membership details pulled from CiviCRM:</li>
  </ol>
  
  <p><a href="https://i.sstatic.net/zP0ar.png" rel="noreferrer"><img src="https://i.sstatic.net/zP0ar.png" alt="enter image description here"></a></p>
  
  <p><strong>To create this Membership Tab:</strong> </p>
  
  <p><strong>a) setup your CiviCRM - Drupal CMS integration</strong> by following the instructions here:
  Administer -> System Settings -> CMS Database Integration
  direct link: <code>civicrm/admin/setting/uf?reset=1</code>
  This makes the CiviCRM tables available in your Drupal Views.</p>
  
  <p><strong>b) on the Drupal side</strong> - enable Drupal Views; and Create a new View - key elements are Relationships -> connecting CiviCRM Contact w/ Drupal user ID and Contextual Filter -> so we can create a path <code>user/%/membership</code> and the Menu item: Tab: <code>Membership</code></p>
  
  <p><strong>c) here is a complete Views configuration for the Page:</strong></p>
  
  <p><a href="https://i.sstatic.net/ShrJp.png" rel="noreferrer"><img src="https://i.sstatic.net/ShrJp.png" alt="enter image description here"></a></p>
  
  <p><strong>2. Hitting the Download Membership Certificate link produces:</strong></p>
  
  <p><a href="https://i.sstatic.net/AZfgs.png" rel="noreferrer"><img src="https://i.sstatic.net/AZfgs.png" alt="enter image description here"></a></p>
  
  <p><strong>To create this Certificate (a PDF download):</strong></p>
  
  <p><strong>a) you need to download and install module: Views PDF</strong> -> which requires libraries: tcpdf and fpdi -> put them in a <code>/libraries folder</code> that is accessible by your site - either <code>sites/default/libraries</code> or <code>sites/all/libraries</code>.</p>
  
  <p><strong>b) when installed -> add a new display in your View -> of type PDF Page.</strong> I've selected PDF fields -> in Settings you can: upload and select a background template of your choice; you can also specify an offset X and Y for each of the CiviCRM variables to position them exactly where you want them!</p>
  
  <p><a href="https://i.sstatic.net/4od0V.png" rel="noreferrer"><img src="https://i.sstatic.net/4od0V.png" alt="enter image description here"></a></p>
  
  <p><strong>c) In your PDF Page View -> Note the path:</strong> </p>
  
  <p><a href="https://i.sstatic.net/kpRqq.png" rel="noreferrer"><img src="https://i.sstatic.net/kpRqq.png" alt="enter image description here"></a></p>
  
  <p><strong>d) Now that you've made the PDF Page display:</strong> add a Field on your <code>user/%/membership</code> page -> Custom text -> e.g. Download Membership Certificate. Hit Rewrite Results -> select Output this field as a link as follows:</p>
  
  <p><a href="https://i.sstatic.net/A2Zuw.png" rel="noreferrer"><img src="https://i.sstatic.net/A2Zuw.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-04T03:42:30.343Z
Answers.Text: Excellent write up. For newbies, you can also set this up as a Block in sidebar left so it is obvious without needing to go to the Tab
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-04T17:41:35.417Z
Answers.Text: Yes add a display: block and use Drupal to position in which ever region and on whatever URL you want!
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T16:39:58.363Z
Answers.Text: Nice write up. How can adopt this for an event participants? Thanks
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T16:59:03.750Z
Answers.Text: Also can this be automated with civirules, so that when a participant is marked as “Attended” they would receive an email with this views link?
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-04T01:14:32.227Z
Answers.LastActivityDate: 2017-09-11T15:40:28.233Z
Answers.LastEditDate: 2017-09-11T15:40:28.233Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>This is a request I get quite often. Below is my favourite solution for it.</p>
  
Tags: <drupal><civimember><drupal-views>
Title: How can Members download their own Membership Certificate/Card in Drupal 7?
ThreadText: # How can Members download their own Membership Certificate/Card in Drupal 7?
  
  (Asked by: username_0 on 2017-09-04)
  
  This is a request I get quite often. Below is my favourite solution for it.
  
  **Tags:** drupal, civimember, drupal-views
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-09-04. Score: 17 | Accepted answer
  
  No custom code required! If you're on Drupal Views integration, which ships with CiviCRM - all that's required here are Drupal modules Views, Views PDF and installation of two libraries for the PDF generation: tcpdf and fpdi;
  
  **Here are the steps:**
  
  1. **First we will create a Membership tab** in your Drupal `/user` screen where we will display the relevant Membership details pulled from CiviCRM:
  
  [![enter image description here](https://i.sstatic.net/zP0ar.png)](https://i.sstatic.net/zP0ar.png)
  
  **To create this Membership Tab:**
  
  **a) setup your CiviCRM - Drupal CMS integration** by following the instructions here:
  Administer -> System Settings -> CMS Database Integration
  direct link: `civicrm/admin/setting/uf?reset=1`
  This makes the CiviCRM tables available in your Drupal Views.
  
  **b) on the Drupal side** - enable Drupal Views; and Create a new View - key elements are Relationships -> connecting CiviCRM Contact w/ Drupal user ID and Contextual Filter -> so we can create a path `user/%/membership` and the Menu item: Tab: `Membership`
  
  **c) here is a complete Views configuration for the Page:**
  
  [![enter image description here](https://i.sstatic.net/ShrJp.png)](https://i.sstatic.net/ShrJp.png)
  
  **2. Hitting the Download Membership Certificate link produces:**
  
  [![enter image description here](https://i.sstatic.net/AZfgs.png)](https://i.sstatic.net/AZfgs.png)
  
  **To create this Certificate (a PDF download):**
  
  **a) you need to download and install module: Views PDF** -> which requires libraries: tcpdf and fpdi -> put them in a `/libraries folder` that is accessible by your site - either `sites/default/libraries` or `sites/all/libraries`.
  
  **b) when installed -> add a new display in your View -> of type PDF Page.** I've selected PDF fields -> in Settings you can: upload and select a background template of your choice; you can also specify an offset X and Y for each of the CiviCRM variables to position them exactly where you want them!
  
  [![enter image description here](https://i.sstatic.net/4od0V.png)](https://i.sstatic.net/4od0V.png)
  
  **c) In your PDF Page View -> Note the path:**
  
  [![enter image description here](https://i.sstatic.net/kpRqq.png)](https://i.sstatic.net/kpRqq.png)
  
  **d) Now that you've made the PDF Page display:** add a Field on your `user/%/membership` page -> Custom text -> e.g. Download Membership Certificate. Hit Rewrite Results -> select Output this field as a link as follows:
  
  [![enter image description here](https://i.sstatic.net/A2Zuw.png)](https://i.sstatic.net/A2Zuw.png)
  
  > **Comments:**
  > **username_1**: Excellent write up. For newbies, you can also set this up as a Block in sidebar left so it is obvious without needing to go to the Tab  
  > **username_0**: Yes add a display: block and use Drupal to position in which ever region and on whatever URL you want!  
  > **username_2**: Nice write up. How can adopt this for an event participants? Thanks  
  > **username_2**: Also can this be automated with civirules, so that when a participant is marked as “Attended” they would receive an email with this views link?  
  
  ---
  
  