We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20482
    • 3 Posts
    I’ve got a ton of online product documentation on a ModX site (several hundred pages).

    I would like to find a ModX add-on or even a stand-alone script that can read the ModX pages and dynamically convert them to a PDF manual by following the page relationships set up in Modx, and intelligently (somehow) following the order of the links.

    Does anyone know of anything out there like this? If not... is there anyone out there that might be willing to work with me to write it?

    Thanks in advance.
      • 10449
      • 956 Posts
      I’d use a library such as http://html2fpdf.sourceforge.net/ or http://www.digitaljunkies.ca/dompdf/ to generate a single PDF per modx page.

      Use Ditto or Wayfinder to generate a list of all the modx documents. Or the sitemap snippet.

      Write a few lines of PHP to loop through all the modx docs and generate PDFs. I’d add a prefix with autonumbering for the filenames (see next step).

      Once you have all the PDFs, grab them all in Adobe Acrobat (not the reader) and join them together in one big fat file. iirc, the feature is called "merge files" or something along those lines. If the filenames are alphanumerically sorted, you won’t have to re-arrange the doc-order here.

      Done. smiley

        • 25663 MODX Staff
        • 12,272 Posts
        We have modified one of the PDF libraries for a project we’re developing now and use CSS to control the output. There is rudimentary support for automatic page numbering and a few more layout oriented items, but no sophisticated layout controls or transparency. It’s used to dynamically create printable PDF contracts.

        In order to pull it off, you really need to have a server you can tweak the PHP config, as they’re very memory intensive. I suspect that a caching system could be built around this bit of code we’ve created, but it’s definitely not ready for broad distribution.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 6726
          • 7,075 Posts
          Nice to know...

          Paul had started working on something a while back but I think he never got around to finish it... I had suggested the TCPDF library, if that helps...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 25663 MODX Staff
            • 12,272 Posts
            Ours is working really well actually and we’re quite happy with the results. But like I said, it’d be quite difficult to support since the server makes a big difference. I believe we’re using xhtml2pdf.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 6726
              • 7,075 Posts
              Cool cool

              I didn’t mean to imply otherwise, just that Paul had done some work on this and it might be mutualized smiley
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 25663 MODX Staff
                • 12,272 Posts
                LOL ... never thought you implied anything so definitely no sweat. A couple of hard requirements we had and why we choose the library we did were nested list support and support for floats and absolute positioning. That’s not saying others don’t do it, but we got this sucker working and made some code contributions back to the original source code I think based on our enhancements.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 20482
                  • 3 Posts
                  Wow... I feel like I hit a nerve. Didn’t expect the responses... but really appreciate all the info, links and history. Sounds like this is something a LOT of people would like to see happen.

                  I’m very interested in making it happen... for me... but I honestly don’t have the time to delve into it all.

                  If anyone is willing to do it for a few bucks... I’d be happy to talk. But if the community is getting the benefit of it as well... which I would prefer... then it can’t be a lot of bucks.


                    • 20482
                    • 3 Posts
                    Quote from: ganeshXL at Nov 06, 2007, 08:39 AM

                    Once you have all the PDFs, grab them all in Adobe Acrobat (not the reader) and join them together in one big fat file. iirc, the feature is called "merge files" or something along those lines.

                    The problem here is that the documentation changes rather regularly, and there is so darn much of it that I really need a completely automated solution. I cannot afford to have to muck through hundreds of pdf files and merge them every few days. And... I want the pdf to always be 100% up-to-date with the actual online info... so if someone downloads the pdf today, they get exactly what the online docs say today.

                    But... thanks for the thought of it.

                    Tim
                      • 473
                      • 70 Posts
                      I hope someday Packt Publishing release a book/ebook about Modx Tutorial grin , sorry my english