We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43592
    • 97 Posts
    Hi Modx-forum members,

    I've a question to the plugin PDFRessource, which is not working on my site.

    First I've installed the package, have put in the

    [[*live_pdf]] TV in my template in the <header>-section.

    The TV is checked in the Template, php E_Notice shows "0" (zero) in the frontend.

    By clicking on:
    <a target="_blank" href="[[*id:pdfresourcelink]]">PDF</a>

    The link opens a new window
    http://[domain]/assets/pdf/index/[nameoftheressource].pdf but cannot be shown because of "internal server error".

    Rights of the assets-directory of the windows-server are set well for writing and updating.


    Any ideas?

    This question has been answered by Jako. See the first response.

      • 43592
      • 97 Posts
      I misinterpreted "checking the TV" it means in the ressource, too, not only in the template for activating it.

      Now I get a blank PDF with the title of the ressource in the head.

      Error console:
      [2016-03-31 09:07:17] (ERROR in modPDF @ /index.php) customFonts does not contain an array.
      [2016-03-31 09:13:59] (ERROR in modPDF @ /index.php) customFonts does not contain an array.
      [ed. note: sspind last edited this post 8 years ago.]
      • Please ask your questions on the PDFResource GitHub Repository next time. I don't watch active the MODX forums for my extras.

        Quote from: sspind at Mar 31, 2016, 07:16 AM
        Error console:
        [2016-03-31 09:07:17] (ERROR in modPDF @ /index.php) customFonts does not contain an array.
        [2016-03-31 09:13:59] (ERROR in modPDF @ /index.php) customFonts does not contain an array.

        The message is only a warning, that the pdfresource.customFonts system setting is not a valid JSON encoded array. The blank page with the title is generated because the default the tplPDF chunk contains this:

        <!DOCTYPE html>
        <html>
        <head>
            <meta charset="UTF-8">
        </head>
        <body>
        <h1>[[+pagetitle]]</h1>
        [[+content]]
        </body>
        </html>
          • 43592
          • 97 Posts
          Ok Thank you .. is there a simple possibilty to just put the whole template within every snipped and TV into a PDF or do I need another Plugin?
          • discuss.answer
            It is not possible with the current code, because it does not make much sense. If you want to use the same template, you could better use the Browser and print to PDF on client side.

            Normally you would create your own template chunks to change the output of PDFResource. Inside those chunks, you could call the same chunks that you use in the page template for sure.