We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37437
    • 147 Posts
    I am using the PrintDoc snippet and - for the most part - have managed to get it up and running. I am having some difficulties formatting the output of the pages selected for printing however. (I am working with MODx 0961p2)

    This is what I have done:

    1. I created a PrintDoc snippet and populated it with all of the content from the PrintDoc Snippet.php file.

    2. I created a document called ’Print’ and placed the following PrintDoc snippet call into the content area: [!PrintDoc? &print_doc=`78` &tpl=`tpl_print`!]

    3. I assigned ’blank’ as the template for the Print document created in Step2 above.

    4. I created a chunk (named ’tpl_print’) and placed the following code in the chunk:

    ---------------------------------------------------------------
    <input type="button"
    onClick="window.print()"
    value="Print This Page"/>

    <table border="0" width="100%" align="center">
    <tr style="font-size: 11px;">
    <td align="left" style="padding-bottom: 5px;"><div class="title" style="font-size: 11px;">[+longtitle+]</div></td>
    </tr>
    <tr>
    <td align="left"><div style="font-size: 9px; padding-bottom: 20px; padding-left: 20px">[+description+]</div></td>
    </tr>
    <tr>
    <td>[+content+]</td>
    </tr>
    </table>

    ------------------

    5. I placed the following snippet call in the Template that formats all the pages that include the print button: <div style="width: 100%; text-align: center; margin-bottom: 7px;">[!PrintDoc? &print_doc=`78`!]</div>


    When I click the print button on a page, a secondary window opens and the appropriate content is there. It is not formatted according to the inline CSS specified in the ’tpl_print’ chunk (step 4 above) however. The ’Print This Page’ button does display, but I just can not get the other content to format properly. (For instance, I want the Title to be 11px, and it displays in something like 20px,)

    Any insights on how to resolve this issue would be greatly appreciated. Again, the snippet call is just not formatting according to the inline css in my template chunk.

    Much thanks.