<p>I've had this same problem getting Printmaker use an external stylesheet.</p>

<p>Simply putting the styles in the head of the template sorted it out.</p>

<p>You could also try setting the path to your css with a <code>.</code> like so;</p>

<pre><code>&lt;link href="./path/to/styles.css" rel="stylesheet" type="text/css"&gt;
</code></pre>

CC BY-SA 3.0
2017-09-20T16:48:26.600Z
2017-09-20T18:01:24.820Z
2017-09-20T18:01:24.820Z
foamcow
<p>I have managed to get Printmaker up &amp; running, spitting out images, entry data, tags etc. However I cannot style the output.</p>

<p>I have built up a template which has a html structure and links to an internal (same domain) CSS file. However the outputted style is browser-default sans serif text and no styling whatsoever.</p>

<p>Here is my template code:</p>

<pre><code>&lt;html class="" lang="en-gb"&gt;
    &lt;head&gt;
        &lt;link rel="stylesheet" href="/css/templates.css"&gt;
    &lt;/head&gt;

&lt;body&gt;

    &lt;div class="wrapper"&gt;

            &lt;section class="page"&gt;

              // Page content here...
</code></pre>

<p>I have tried the <code>.pdfFromTemplate</code> method:</p>

<pre><code>{% set vars = {
    entry: entry
} %}
{% set settings = { 
    orientation : 'portrait',
    filename: entry.slug,
    cacheDirectory: 'pdf/' ~ craft.request.getSegment(1) ~ '/' ~ craft.request.getSegment(2)
} %}
{% set pdfUrl = craft.printmaker.pdfFromTemplate('technical-information/_pdf', vars, settings).url %}
</code></pre>

<p>And also the <code>.pdfFromHtml</code> way, too:</p>

<pre><code>{% set html %}
    {{ include('technical-information/_pdf') }}
{% endset %}
{% set settings = { 
    orientation : 'portrait',
    filename: entry.slug,
    cacheDirectory: 'pdf/' ~ craft.request.getSegment(1) ~ '/' ~ craft.request.getSegment(2)
} %}
{% set pdfUrl = craft.printmaker.pdfFromHtml(html, settings).url %}
</code></pre>

CC BY-SA 3.0
2016-08-30T08:50:06.630Z
Does Printmaker require CSS style to be inline, or even inline within <style> tags in the head of the document? Or does it allow linking to stylesheets?
Adam Menczykowski
<plugin-printmaker>
Render styled output using Printmaker plugin
# Render styled output using Printmaker plugin

(Asked by: username_0 on 2016-08-29)

I have managed to get Printmaker up & running, spitting out images, entry data, tags etc. However I cannot style the output.
I have built up a template which has a html structure and links to an internal (same domain) CSS file. However the outputted style is browser-default sans serif text and no styling whatsoever.
Here is my template code:

    
        
    



    

            

              // Page content here...

I have tried the .pdfFromTemplate method:
{% set vars = {
    entry: entry
} %}
{% set settings = { 
    orientation : 'portrait',
    filename: entry.slug,
    cacheDirectory: 'pdf/' ~ craft.request.getSegment(1) ~ '/' ~ craft.request.getSegment(2)
} %}
{% set pdfUrl = craft.printmaker.pdfFromTemplate('technical-information/_pdf', vars, settings).url %}

And also the .pdfFromHtml way, too:
{% set html %}
    {{ include('technical-information/_pdf') }}
{% endset %}
{% set settings = { 
    orientation : 'portrait',
    filename: entry.slug,
    cacheDirectory: 'pdf/' ~ craft.request.getSegment(1) ~ '/' ~ craft.request.getSegment(2)
} %}
{% set pdfUrl = craft.printmaker.pdfFromHtml(html, settings).url %}

**Tags:** plugin-printmaker
> **Comments:**
> **username_0**: Does Printmaker require CSS style to be inline, or even inline within <style> tags in the head of the document? Or does it allow linking to stylesheets?  

---

## 1 answers

### Answer by username_1 on 2017-09-20. Score: 2

I've had this same problem getting Printmaker use an external stylesheet.
Simply putting the styles in the head of the template sorted it out.
You could also try setting the path to your css with a . like so;


---

