Hot answers tagged

5

I found any relative link should not lead with a slash.


3

Try setting: 'pdfAllowRemoteImages' => true, in your commerce.php config file.


3

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 ...


2

The PDF renderer uses DOMPDF, which expects a HTML document to be supplied. See the DOMPDF documentation to see what types of images are supported. If you are linking images from a different domain you will need to set the commerce.php config setting of pdfAllowRemoteImages to true. https://docs.craftcms.com/commerce/v2/configuration.html#...


2

Depending on your server setup, DOMPDF might be resetting the output buffer when the PDF is generated. This is a fairly rare issue, but I have heard of it before. Solution: Try moving the Printmaker PDF-generation code to the top of the template before any output. For example, at the top of the template... {% set pdfUrl = craft.printmaker.pdfFromTemplate('...


2

This should be fixed as of Commerce 1.2.1354 https://craftcommerce.com/changelog#build1354


2

I came across the same issue yesterday. After a bit of reading and trial and error I found the most elegant way for now is to remove the white space between these elements. <html><head> </head><body> </body></html> Personally I achieved this by adding comments <!-- --> between to remove the white space <html&...


2

I've not yet tested specifically with Printmaker (only Laravel + Dompdf), but you should be able to add page numbers by using a special <script> block in the template you use for PDF rendering. This block's PHP instructions will be interpreted by Dompdf as it renders your document, so you can position additional elements like page numbers, headers/...


1

I think this question does not really belong here but I'll answer it anyway. Sarafi changed the way it displays PDF documents. You can see instructions from Adobe how to enable the browser view. Besides that you have not really a chance to force other Safari users to open PDFs in their browsers. You can as well see other multiple other discussions about it ...


1

Have you tried to use a absolute path without the «/» at the beginning? (or actually a relative one from the webroot…) <img src="assets/images/site/logo.png" /> This did the trick in my case.


Only top voted, non community-wiki answers of a minimum length are eligible