We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28439
    • 222 Posts
    htmtToPDF is only for MODx Evolution (currently up to 1.5)

    This MODx snippets uses TCPDF, available at http://www.tcpdf.org/, to create the PDF Files from the content of a web document, published with MODx. TCPDF is part of the package.
    The main goal is to create highly configurable PDF documents. This is possible with a lot of parameters, that one can use on a call and the usage of chunks. All chunks make use of the placeholders as defined in other MODx snippets.

    The project is hosted on GitHub, you will find everything on the project page at https://github.com/sjstoelting/MODx-htmlToPDF.

    Downloads are available at GitHub on https://github.com/sjstoelting/MODx-htmlToPDF/downloads.


    Installation instructions for htmlToPDF

    The TCPDF files are part of this package.

    Upload all files inside the assets folder to your web-space. The lib folder already contains a htacces file, that disallows every call from the web.
    If you don’t want to use the default path used for TCPDF and htmlToPDF, that is not a problem, but you need to configure the snippet with the path informations,
    or give the path informations with the snippet call.

    If you want a logo in the page header, you have to upload the logo the folder assets/lib/tcpdf/images/. This is because TCPDF only uses this folder, to
    look images files.

    Create two new snippets:
    htmlToPDF -> assets/snippets/htmlToPDF/snippet.htmlToPDF.php.tpl
    getCurrentDocID -> assets/snippets/htmlToPDF/snippet.getCurrentDocID.php.tpl

    Create the PDF output path and give the rights, to create and delete files there (777). The default is assets/pdf/, but you may configure it to fit your
    needs.

    No create the chunks, that you want to use in your snippet calls. You may create different chunks for different websites, if you use htmlToPDF in different
    templates.
    Open the templates, where you want to use htmlToPDF and add the call to the chunk at the top of the template. Here is an example of a call:
    [!htmlToPDF? &author=`Stefanie Janine Stoelting` &tvKeywords=`documentTags` &headerLogo=`logo.png` &chunkContentFooter=`pdf-contentfooter` &chunkStandardHeader=`pdf-header-text` &chunkStyle=`pdf-style`!]

    For further information about the snippet parameters read the documentation in parameter-descriptions.html, that is part of the package or visit the project site on GitHub at https://github.com/sjstoelting/MODx-htmlToPDF.

    The file assets/snippets/htmlToPDF/chuncks/pdf-link.txt contains a chunk to generate a link for the PDF download. If you place the call outside the content, the link to the PDF call is not part of the PDF document.
      Gone away and found a better place to stay
      • 23196
      • 14 Posts
      very nice i have been looking for a functional pdf convector. however I can not get it to work. has anyone tested it on revolution?
        • 34001
        • 428 Posts
        Hi,
        Quote from: phantomphondler at Feb 23, 2011, 04:33 AM

        very nice i have been looking for a functional pdf convector. however I can not get it to work. has anyone tested it on revolution?
        This snippet has been developped for MODx Evolution.
        That said, it would be useful to have it working on MODx Revolution

        Stefanie, have you got some plans to convert it to Revo ? smiley
          Intégrateur web freelance
          • 28439
          • 222 Posts
          Yes, htmlToPDF is only for Evo. That is because I don’t use Revo by now.

          Currently I don’t use Revo, because the most platforms, where I’ve used MODx by now are B2B systems. And there it is absolutely necessary, to have separated front-end and back-end users. And to have them mixed up, as they are at least with Revo, is a problem there.

          In the future I may develop htmlToPDF for Revo, but not in the near future.
            Gone away and found a better place to stay
            • 23196
            • 14 Posts
            ok thanks, i will see what I can do with my limited skills. if I manage to get it to work or if I find an alternative solution I will post it here
              • 3749
              • 24,544 Posts
              Quote from: Stefanie at Feb 23, 2011, 06:50 AM

              Yes, htmlToPDF is only for Evo. That is because I don’t use Revo by now.

              Currently I don’t use Revo, because the most platforms, where I’ve used MODx by now are B2B systems. And there it is absolutely necessary, to have separated front-end and back-end users. And to have them mixed up, as they are at least with Revo, is a problem there.

              In the future I may develop htmlToPDF for Revo, but not in the near future.

              Hi Stefanie,

              Thanks for contributing this. I predict that it will be very popular. cool

              I’m also glad to see more people putting their packages on GitHub.

              FWIW, you can definitely separate Manager users and Web users in Revolution, it takes a different method, but you have much more control over what users can see and do.

              If a user has access to the web context, but not the mgr context, they can’t log in to the Manager at all, just like in Evolution (and vice versa).
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 28439
                • 222 Posts
                Hi BobRay

                thanks for the complements.

                Yes, I know the solution to separate but it does not fit my needs. Almost every time on B2B platforms, there is a centralized login server, where you verify the users. Most of them are called by SOAP, some of the newer ones uses REST. With other systems, you would not how, how to check the login, that is just a pain in the...

                At least the users are logged in after checking their login and password and than I check whether the user exist in MODx or not. If he not exists, he is created. Then the MODx login starts. To reduce problems of changing passwords on the master system, the users become all the same password on MODx. As the front-end login is only available after the login check on the master system, this is not a problem at all.

                In this scenario it is important for most of the customers, that there is no chance to mix up front-end and back-end users. In Evolution is definitely no chance to mix them up.

                But there are a lot of other reasons, why I don’t use Revolution by now, but that is another discussion.

                Kind regards

                Stefanie
                  Gone away and found a better place to stay
                  • 20413
                  • 2,877 Posts
                  Thank you for sharing! smiley
                    @hawproductions | http://mrhaw.com/

                    Infograph: MODX Advanced Install in 7 steps:
                    http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                    Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                    http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower