Answers.Body: <p>Not tested yet, but can you try calling <code>/civicrm/contribute/invoice?reset=1&amp;id=&lt;contribution_id&gt;&amp;cid=&lt;contact_id&gt;</code> in the href instead of <code>javascript:window.print()</code>?</p>
  <p>Note that the token <code>&lt;contribution_id&gt;</code> is the payment id that was created after you submitted the contribution form. <code>&lt;contact_id&gt;</code> is the id of the contact to which contribution belongs. Check if you can already get this in the thankyou template variables. More info - <a href="https://docs.civicrm.org/dev/en/latest/tools/debugging/#in-smarty-template-files" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/tools/debugging/#in-smarty-template-files</a></p>
  <p>Also, make sure you've permission to download the invoice. I think civi requires either <code>access CiviContribute</code> or <code>view my invoices</code>.</p>
  <p>UPDATE - For Joomla - The url is - <code>/index.php?option=com_civicrm&amp;task=civicrm/contribute/invoice&amp;reset=1&amp;id=&lt; contribution_id&gt;&amp;cid=&lt;contact_id&gt;</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T15:20:49.797Z
Answers.Text: Unfortunately, using the exact contribution Id and contact ID with that path only brings me to a front end page of a contribution summary for the user, along with the options to view, edit or delete any contributions.
Answers.UserDisplayName: Kurt Leadley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T15:28:05.500Z
Answers.Text: I inspected the print button and found it was `/index.php?option=com_civicrm&task=civicrm/contribute/invoice&reset=1&id=152&cid=3` You basically had it, but the `?` was a `&` after invoice.
Answers.UserDisplayName: Kurt Leadley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T19:55:19.140Z
Answers.Text: thanks Kurt - i edited the answer to correct that.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-13T02:38:25.450Z
Answers.Text: looks like you're on joomla. In that case, yes, the URL format is different. For drupal users - pls use the original `/civicrm/contribute/invoice?reset=1&id=<contribution_id>&cid=<contact_id>`.
Answers.UserDisplayName: jitendra - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T11:29:47.717Z
Answers.LastActivityDate: 2020-11-13T02:40:19.583Z
Answers.LastEditDate: 2020-11-13T02:40:19.583Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>When completing a contribution, an email can be sent out with an attached PDF called &quot;receipt.pdf&quot;. Is it possible to have this PDF printable on the Thank You page? I currently have a sloppy Print Button on my ThankYou.extra.tpl file, but it is not clean because I am using: <code>$('#crm-main-content-wrapper').before('&lt;div id=&quot;print-button&quot;&gt;&lt;p&gt;&lt;a href=&quot;javascript:window.print()&quot; class=&quot;btn btn-primary&quot;&gt;Print&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;');</code> , which is basically printing the entire webpage. I also tried the <code>&amp;snippet=2</code> approach in the URL, but that is also too sloppy for the client.</p>
  <p>Does anyone know of how to hook into that PDF generation code and spit it out into the ThankYou template?</p>
  
Tags: <civicontribute><pdf><custom-templates>
Title: Thank You page on contribution form. Print option for the PDF that is emailed as "receipt.pdf"
ThreadText: # Thank You page on contribution form. Print option for the PDF that is emailed as "receipt.pdf"
  
  (Asked by: username_0 on 2020-11-11)
  
  When completing a contribution, an email can be sent out with an attached PDF called "receipt.pdf". Is it possible to have this PDF printable on the Thank You page? I currently have a sloppy Print Button on my ThankYou.extra.tpl file, but it is not clean because I am using: `$('#crm-main-content-wrapper').before('<div id="print-button"><p><a href="javascript:window.print()" class="btn btn-primary">Print</a></p></div>');` , which is basically printing the entire webpage. I also tried the `&snippet=2` approach in the URL, but that is also too sloppy for the client.
  
  Does anyone know of how to hook into that PDF generation code and spit it out into the ThankYou template?
  
  **Tags:** civicontribute, pdf, custom-templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-12. Score: 2
  
  Not tested yet, but can you try calling `/civicrm/contribute/invoice?reset=1&id=<contribution_id>&cid=<contact_id>` in the href instead of `javascript:window.print()`?
  
  Note that the token `<contribution_id>` is the payment id that was created after you submitted the contribution form. `<contact_id>` is the id of the contact to which contribution belongs. Check if you can already get this in the thankyou template variables. More info - <https://docs.civicrm.org/dev/en/latest/tools/debugging/#in-smarty-template-files>
  
  Also, make sure you've permission to download the invoice. I think civi requires either `access CiviContribute` or `view my invoices`.
  
  UPDATE - For Joomla - The url is - `/index.php?option=com_civicrm&task=civicrm/contribute/invoice&reset=1&id=< contribution_id>&cid=<contact_id>`
  
  > **Comments:**
  > **username_0**: Unfortunately, using the exact contribution Id and contact ID with that path only brings me to a front end page of a contribution summary for the user, along with the options to view, edit or delete any contributions.  
  > **username_0**: I inspected the print button and found it was `/index.php?option=com_civicrm&task=civicrm/contribute/invoice&reset=1&id=152&cid=3` You basically had it, but the `?` was a `&` after invoice.  
  > **username_2**: thanks username_0 - i edited the answer to correct that.  
  > **username_1**: looks like you're on joomla. In that case, yes, the URL format is different. For drupal users - pls use the original `/civicrm/contribute/invoice?reset=1&id=<contribution_id>&cid=<contact_id>`.  
  
  ---
  
  