Printmaker Plugin — Some Questions Why he generate the PDF again and again when nothing changes? Is there a hidden option for that?
I tried to use it with the Google Font Rubik but no chance. Any Ideas?
Is it possible to Save the generated PDF in an Asset field to the Post?


I've a preparse Field at the Moment but I've nothing what I can prompt if it's exist or not. He also regenerate the PDF on every Save. No cool :/

Here is my Preparse Field

{% spaceless %}
  {% if not entry.preparsePrintmakerCertificate|length %}
    {% set html %}
      &lt;html&gt;
      &lt;head&gt;
        &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;
        &lt;style&gt;
          @page {
            margin: 0in;
          }

          @font-face {
            font-family: 'Rubik Webfont';
            src: url('/assets/fonts/Rubik-Black.ttf') format('truetype');
            font-weight: 900;
            font-style: normal;
          }

          body {
            font-family: "Rubik Webfont", sans-serif;
            font-weight: 900;
            margin: 0;
            padding: 0;
            font-size: 160px;
            line-height: 1;
            width: 100%;
            height: 100%;
            position: relative;
            color: #2e3743;
            text-transform: uppercase;
            letter-spacing: -6px;
            background-image: url('/assets/images/bitmap/printmaker/certificate_background.png');
          }

          .background {
            position: fixed;
            width: 100%;
            height: 100%;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
          }

          .name {
            position: fixed;
            width: 1000px;
            left: 356px;
            top: 2764px;
          }

          .date {
            position: fixed;
            width: 900px;
            left: 356px;
            top: 4318px;
          }
        &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;div class="background"&gt;
        &lt;div class="name"&gt;
          {{ entry.title }}
        &lt;/div&gt;
        &lt;div class="date"&gt;
          &lt;span class="month"&gt;{{ entry.postDate.format('M') }}&lt;/span&gt;
          &lt;span class="day"&gt;{{ entry.postDate.format('d') }}&lt;/span&gt;&lt;br/&gt;
          &lt;span class="year"&gt;{{ entry.postDate.format('Y') }}&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
    {% endset %}

    {% set settings = {
        filename : 'bestwebsite-gallery_sotd_' ~ entry.postDate.format('Y-m-d') ~ '_' ~ entry.slug|kebab
    } %}
    {% set pdfUrl = craft.printmaker.pdfFromHtml(html, settings).url %}
    {{ pdfUrl }}
  {% endif %}
{% endspaceless %}
Unfortunately, Printmaker must regenerate the PDF on every save... It can’t simply check to see whether a certain PDF file already exists, because the underlying content or template may have changed that PDF was last generated. You can use Craft's template caching to capture PDF URLs/filenames, to avoid unnecessarily generating the PDF if you know the underlying content hasn't changed.
You can use Google Fonts (or any other external web font) by linking an external stylesheet, or by including the @font-face directive in your inline styles.
Printmaker saves PDF to files in a cache directory that you specify, but it doesn't create or update an Asset element. You could write a custom plugin to do that, leveraging Printmaker's API. Alternatively, you can commission Top Shelf Craft to develop the functionality you need.


Feel free to write support@topshelfcraft.com or post additional questions here on SE if I can be of further help!