We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16020
    • 43 Posts
    How do you print a document? My site is very image heavy, and I have utilized what I could from this site:
    http://modxcms.com/extras/package/352

    Using Print Document, I have the code within the snippit, a new template, a chunk and a link on the page:
    http://www.lifewater.org/modx/index.php?id=79

    The link is linked as:<a href="[~181~]&print=[*id*]"></a>
    Which takes you to the new page, but only contains "print"

    The print page contains: [[PrintDoc? &print_doc=`(this document ID)` &tpl=`print`]]


    Help me please smiley
      • 36926
      • 701 Posts
      Quote from: klarsen7 at Sep 30, 2009, 03:36 PM

      How do you print a document? My site is very image heavy, and I have utilized what I could from this site:
      http://modxcms.com/extras/package/352

      Using Print Document, I have the code within the snippit, a new template, a chunk and a link on the page:
      http://www.lifewater.org/modx/index.php?id=79

      The link is linked as:<a href="[~181~]&print=[*id*]"></a>
      Which takes you to the new page, but only contains "print"

      The print page contains: [[PrintDoc? &print_doc=`(this document ID)` &tpl=`print`]]


      Help me please smiley

      Not used the printdoc snippet, but can’t you achieve what you need with a print CSS?

      Useful article
      http://www.alistapart.com/articles/goingtoprint/

      Ben
        • 16020
        • 43 Posts
        Yes, I did that actually.

        I’d also like to have a button though because people don’t seem to be that "savvy" to just hit print...

        I really like exactly how the Print button on this site (the forums) makes it into a black and white simple text page. How is that done then? I figured it would be using Modx, but I suppose any way would be great if it works.
          • 3749
          • 24,544 Posts

          This will give you a button:

          <div class="dontprint">
                  <form><input type="button" value=" Print this coupon "
          onclick="window.print();return false;" /></form>
              </div>


          The "dontprint" class is set to hidden in the CSS file so you don’t print the button.
            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
            • 16020
            • 43 Posts
            Well the print using the <form> does work.
            I guess I was hoping for it to open in a new window without formatting. I did create a css print style, so the user can just us File>Print, but I’d like to have a styled button so that it’s not the automatically generated one and it is something obvious that the users can find easily.

            How do you do this?
              • 3749
              • 24,544 Posts
              It’s not really a MODx question, I’m afraid.

              Google is your friend: http://www.google.com/search?q=custom+button+html&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1
                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
                • 36926
                • 701 Posts
                Quote from: klarsen7 at Oct 01, 2009, 05:36 PM

                Well the print using the <form> does work.
                I guess I was hoping for it to open in a new window without formatting. I did create a css print style, so the user can just us File>Print, but I’d like to have a styled button so that it’s not the automatically generated one and it is something obvious that the users can find easily.

                How do you do this?

                Do you need to present the users with another window? If you feel the user wont go file>>print couldn’t you just have a print button that prints for them directly without the pop up.

                onClick="window.print()
                  • 16020
                  • 43 Posts
                  That would work out great. I might use the on window click.

                  I would love it to work like it does on this forum page where it opens in a new window, so if anyone knows how to do this, that would be wonderful. Thank you!
                    • 3749
                    • 24,544 Posts
                    Quote from: klarsen7 at Oct 02, 2009, 10:15 AM

                    That would work out great. I might use the on window click.

                    I would love it to work like it does on this forum page where it opens in a new window, so if anyone knows how to do this, that would be wonderful. Thank you!


                    Ummm... that’s what I originally suggested. huh
                      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
                      • 24465
                      • 3 Posts
                      Can you print from any other documents (WORD, TXT, etc) to a real printer? You do have to select a printer unless the default printer is what you want to use. We can’t really see what you are doing, so if you can’t figure out what I mentioned, then you will need to provide the individual steps you are using to try to print the PDF. You will need to tell us the name of the printer and such. kiss

                      Regards....
                      Randy
                      _______________________________________________________________________________________________
                      washington drunk driving | all natural skin care products | collection agency