Answers.Body: <p>We've used it successfully to generate PDF tickets for orders. It may/may not help in your case.</p>
  
  <p>On our order page, we simply have:</p>
  
  <pre><code>&lt;a target="_blank" href="/orders/tickets?orderId={{ order.number }}"&gt;Download PDF Tickets&lt;/a&gt;
  </code></pre>
  
  <p>Then, our <code>order/tickets</code> template:</p>
  
  <pre><code>{% set html %}
      {% set orderId = craft.request.param('orderId') %}
  
      // HTML/CSS to generate ticket
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
      &lt;style&gt;
  
      body {
          font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
          font-size: 13px;
          line-height: 1.4em;
          font-weight: bold;
      }
  
      &lt;/style&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
  
          // Ticket HTML
  
      &lt;/body&gt;
  
      &lt;/html&gt;
  
  {% endset %}
  
  {% set settings = {
      compress: true,
      orientation: 'portrait',
      size: 'letter',
      cacheDirectory: 'cache/tickets',
      filename: 'TICKET-' ~ craft.request.param('orderId') ~ '.pdf'
  } %}
  
  {% set pdf = craft.printmaker.pdfFromHtml(html, settings) %}
  
  {{ pdf.output }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T14:14:52.727Z
Answers.Text: Thanks for your help!  I now seem to be getting somewhere....  I've used this href="/barristerPDF?entryId={{ entry.id }}" to link to the PDF template.  Unfortunately the PDF is blank due to non of the field data being pulled through?  My URL has /barristerPDF?entryId=201 which is the correct entry ID?
  
  I've stripped back to just {{ entry.title }} as a test but nothing :(
Answers.UserDisplayName: Martin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T15:49:54.600Z
Answers.Text: @Martin do you have an craft.entries criteria model in your template to get the entry with that ID?
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T15:56:51.193Z
Answers.Text: @carlcs - Yes I added an Criteria Model but i'm really just flying blind now :/  {% set entryId = craft.request.param('entryId') %}   {% set entries = craft.entries.section('barristers') %}
Answers.UserDisplayName: Martin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T15:57:59.240Z
Answers.Text: @Martin Try this: `{% set entry = craft.entries.id(entryId).first() %}`
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T17:33:32.780Z
Answers.Text: Yay!!  It's working :D  Thanks @carlcs...  Only issue now is the image isn't being pulled... I get the error "DOMPDF_ENABLE_REMOTE is set to FALSE http://macbook.local:5757/img/barristers/image.jpeg
Answers.UserDisplayName: Martin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T17:43:06.447Z
Answers.Text: Sorry, I found DOMPDF_ENABLE_REMOTE is set to FALSE in the DomPDF config files and set it to true.
Answers.UserDisplayName: Martin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-17T12:18:48.300Z
Answers.Text: @Martin where did you find `DOMPDF_ENABLE_REMOTE` I am having the same issue? Thanks.
Answers.UserDisplayName: Gareth
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-17T14:08:05.407Z
Answers.Text: Found it, its located at: craft/plugins/printmaker/vendor/dompdf/dompdf_config.inc.php for anyone else.
Answers.UserDisplayName: Gareth
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-17T15:49:45.807Z
Answers.Text: Ahh... good @Gareth, was just about to reply :)
Answers.UserDisplayName: Martin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T12:23:49.277Z
Answers.LastActivityDate: 2015-10-23T12:23:49.277Z
Answers.UserDisplayName: crawf
Answers.Body: <p>Martin,</p>
  
  <p>For reference, here's the template code you shared with me earlier:</p>
  
  <pre><code>{% set html %}
  
  {% set entryId = craft.request.param('entryId') %}
  
      &lt;html&gt;
      ...    
      &lt;body&gt;
      {{ entry.title }} 
      &lt;/body&gt;
      &lt;/html&gt;
  
  {% endset %}
  
  {% set settings = {
      ...
  } %}
  
  {% set pdf = craft.printmaker.pdfFromHtml(html, settings) %}
  
  {{ pdf.output }}
  </code></pre>
  
  <p>You're using an <code>entry</code> variable to reference your entry content, but you haven't created such a variable in your template yet.</p>
  
  <p>Also, while <code>{% set entryId = craft.request.param('entryId') %}</code> is valid as a statement by itself, I think it might be conflicting with the opening of your <code>{% set html %}</code> tag pair.</p>
  
  <p>Try this instead:</p>
  
  <pre><code>{% set entryId = craft.request.getParam('entryId') %}
  
  {% set entry = craft.entries.id(entryId).first %}
  
  {% set html %}
      ...
  {% endset %}
  
  ...
  </code></pre>
  
  <p>Check out the <a href="http://michaelrog.com/craft/printmaker" rel="nofollow">Printmaker docs</a> for more code examples.</p>
  
  <p>Cheers!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T21:26:43.500Z
Answers.Text: Ooops, looks like a connection glitch on my end delayed this post 'til just now. Glad to see yall already got it sorted.  :)
Answers.UserDisplayName: Michael Rog
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T21:22:13.510Z
Answers.LastActivityDate: 2015-10-23T21:22:13.510Z
Answers.UserDisplayName: Michael Rog
Body: <p>Has anyone had any success with Printmaker PDF plugin?</p>
  
  <p>I’m not sure where to put the tags?  The only way I can get the template to actually load is to add the Printmaker tags at the end of the document.  In which case, the "Download CV" link further up the page doesn’t work.  It seems {{ pdf.url }} HAS to appear AFTER the Printmaker tags.  If I move the Printmaker tags further up I get the error "Internal Server Error - Requested HTML document contains no data.”.</p>
  
  <p>Also, i’ve linked to a print stylesheet and when I do get a document to be created the print.css is ignored?</p>
  
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-12T16:08:54.837Z
Comments.Text: Quite disappointed with the plugin myself, the docs are skeleton at best.
Comments.UserDisplayName: erwinheiser
Tags: <pdf><plugin-printmaker>
Title: Help with Printmaker Plugin
ThreadText: # Help with Printmaker Plugin
  
  (Asked by: username_0 on 2015-10-23)
  
  Has anyone had any success with Printmaker PDF plugin?
  
  I’m not sure where to put the tags? The only way I can get the template to actually load is to add the Printmaker tags at the end of the document. In which case, the "Download CV" link further up the page doesn’t work. It seems {{ pdf.url }} HAS to appear AFTER the Printmaker tags. If I move the Printmaker tags further up I get the error "Internal Server Error - Requested HTML document contains no data.”.
  
  Also, i’ve linked to a print stylesheet and when I do get a document to be created the print.css is ignored?
  
  Thanks
  
  **Tags:** pdf, plugin-printmaker
  
  > **Comments:**
  > **username_1**: Quite disappointed with the plugin myself, the docs are skeleton at best.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-10-23. Score: 3
  
  We've used it successfully to generate PDF tickets for orders. It may/may not help in your case.
  
  On our order page, we simply have:
  
  ```
  <a target="_blank" href="/orders/tickets?orderId={{ order.number }}">Download PDF Tickets</a>
  
  ```
  
  Then, our `order/tickets` template:
  
  ```
  {% set html %}
      {% set orderId = craft.request.param('orderId') %}
  
      // HTML/CSS to generate ticket
      <html>
      <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      <style>
  
      body {
          font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
          font-size: 13px;
          line-height: 1.4em;
          font-weight: bold;
      }
  
      </style>
      </head>
  
      <body>
  
          // Ticket HTML
  
      </body>
  
      </html>
  
  {% endset %}
  
  {% set settings = {
      compress: true,
      orientation: 'portrait',
      size: 'letter',
      cacheDirectory: 'cache/tickets',
      filename: 'TICKET-' ~ craft.request.param('orderId') ~ '.pdf'
  } %}
  
  {% set pdf = craft.printmaker.pdfFromHtml(html, settings) %}
  
  {{ pdf.output }}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks for your help!  I now seem to be getting somewhere....  I've used this href="/barristerPDF?entryId={{ entry.id }}" to link to the PDF template.  Unfortunately the PDF is blank due to non of the field data being pulled through?  My URL has /barristerPDF?entryId=201 which is the correct entry ID?  I've stripped back to just {{ entry.title }} as a test but nothing :(  
  > **username_3**: @username_0 do you have an craft.entries criteria model in your template to get the entry with that ID?  
  > **username_0**: @username_3 - Yes I added an Criteria Model but i'm really just flying blind now :/  {% set entryId = craft.request.param('entryId') %}   {% set entries = craft.entries.section('barristers') %}  
  > **username_3**: @username_0 Try this: `{% set entry = craft.entries.id(entryId).first() %}`  
  > **username_0**: Yay!!  It's working :D  Thanks @username_3...  Only issue now is the image isn't being pulled... I get the error "DOMPDF_ENABLE_REMOTE is set to FALSE http://macbook.local:5757/img/barristers/image.jpeg  
  > **username_0**: Sorry, I found DOMPDF_ENABLE_REMOTE is set to FALSE in the DomPDF config files and set it to true.  
  > **username_4**: @username_0 where did you find `DOMPDF_ENABLE_REMOTE` I am having the same issue? Thanks.  
  > **username_4**: Found it, its located at: craft/plugins/printmaker/vendor/dompdf/dompdf_config.inc.php for anyone else.  
  > **username_0**: Ahh... good @username_4, was just about to reply :)  
  
  ---
  
  ### Answer by username_5 on 2015-10-23. Score: 1
  
  username_0,
  
  For reference, here's the template code you shared with me earlier:
  
  ```
  {% set html %}
  
  {% set entryId = craft.request.param('entryId') %}
  
      <html>
      ...    
      <body>
      {{ entry.title }} 
      </body>
      </html>
  
  {% endset %}
  
  {% set settings = {
      ...
  } %}
  
  {% set pdf = craft.printmaker.pdfFromHtml(html, settings) %}
  
  {{ pdf.output }}
  
  ```
  
  You're using an `entry` variable to reference your entry content, but you haven't created such a variable in your template yet.
  
  Also, while `{% set entryId = craft.request.param('entryId') %}` is valid as a statement by itself, I think it might be conflicting with the opening of your `{% set html %}` tag pair.
  
  Try this instead:
  
  ```
  {% set entryId = craft.request.getParam('entryId') %}
  
  {% set entry = craft.entries.id(entryId).first %}
  
  {% set html %}
      ...
  {% endset %}
  
  ...
  
  ```
  
  Check out the [Printmaker docs](http://username_5.com/craft/printmaker) for more code examples.
  
  Cheers!
  
  > **Comments:**
  > **username_5**: Ooops, looks like a connection glitch on my end delayed this post 'til just now. Glad to see yall already got it sorted.  :)  
  
  ---
  
  