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:
<html class="" lang="en-gb">
<head>
<link rel="stylesheet" href="/css/templates.css">
</head>
<body>
<div class="wrapper">
<section class="page">
// 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 %}