{"id":741,"date":"2008-02-29T03:45:17","date_gmt":"2008-02-29T09:45:17","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/docs\/?page_id=741"},"modified":"2021-12-08T10:25:43","modified_gmt":"2021-12-08T16:25:43","slug":"converting-reports-to-pdf","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/converting-reports-to-pdf","title":{"rendered":"Output Reports to PDF"},"content":{"rendered":"\n<p>m-Power Reports include the option to output to PDF. The painting for the PDF comes directly from the HTML presentation layer. Therefore, m-Painter is the WYSIWYG editor for HTML, Formatted Excel, and PDF.<\/p>\n\n\n\n<p>Options (shown with default)<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li class=\"padleft\">Page Size and Orientation: Portrait (8.5in x 11in) &#8212; (For landscape, use 11in x 8.5in)<\/li><li class=\"padleft\">Outside Border Page Margin (.5 in)<\/li><li class=\"padleft\">Border (thin solid black)<\/li><li class=\"padleft\">Inside Border Page Margin Padding (.0 in)<\/li><li class=\"padleft\">Footer (Page 1 of 100)<\/li><\/ol>\n\n\n\n<p>These can all be changed per application by tweaking the generated HTML output. To modify these settings from their default, open m-Painter, toggle to the source, and change the PDF settings within the style tag.<\/p>\n\n\n\n<p><strong>Note:<\/strong> You can now change the orientation of your PDF in Application Properties. To change this, open the properties and toggle to the Print Optimized tab. Look for the page_orientation property. Use this property to switch between orientation layouts.<\/p>\n\n\n\n<p>Issues to Consider:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li class=\"padleft\">The conversion from HTML to PDF requires <strong>strictly-formed<\/strong> HTML. Simply put, this means that all HTML tags must be complete. For example, for every begin-table tag (<code>&lt;table&gt;<\/code>), there must be a corresponding end-table tag (<code>&lt;\/table&gt;<\/code>). Even though the HTML might render acceptably in a browser, it might not be complete enough for the conversion from HTML to PDF. If there is a problem with the HTML, you will see an appropriate error message when you attempt to create the PDF output, including some mention of the incomplete tag.<\/li><\/ol>\n\n\n\n<p><strong>Note:<\/strong> For users with data dictionaries older than October 2007, you will need to make two small changes to your Header file. Specifically look for the lines that begin with <code>&lt; img<\/code> and end with <code>&gt;<\/code>.<\/p>\n\n\n\n<p>Be sure to end them with <code>\/&gt;<\/code>. This ensures that the IMG tag is complete and will minimize the chance of generating an error message on the conversion. For example:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li class=\"padleft\">Change this<br><code>&lt; img src =\"\/mrcjava\/image\/ top.jpg \" border=\"0\" &gt;<\/code><br>to read this:<br><code>&lt; img src =\"\/mrcjava\/image\/ top.jpg \" border=\"0\" \/&gt;<\/code><br>By default, there are two images in the mrc header. Be sure to change both of them.<\/li><li class=\"padleft\">In your footer file, you will see one table referenced as <code>&lt;TABLE&gt;<\/code>, please change this to read <code>&lt;table&gt;<\/code>.<\/li><li class=\"padleft\">If you will include images in the PDF output, the best practice is to specifically specify the image alignment. This means using <code>align=\"left\"<\/code> or <code>align=\"right\"<\/code> on the image tag. This should correct any problems you see with image alignment or unwanted spacing gaps.<\/li><\/ol>\n\n\n\n<p>Repeating images used in backgrounds might cause performance problems. The performance problem appears in that it takes longer for the PDF to be created, and any PDF Reader takes a long time to both render and print the output. For the fastest possible responses, consider using a simple color for a background instead of an image. Specifically, in the inline style sheet, mrc_servlet_stylesheet_css.html, consider changing this line:<\/p>\n\n\n\n<p><code>. back { color : black; background-image: url(\"\/mrcjava\/image\/back.gif\"); font: 8pt verdana ;}<\/code><\/p>\n\n\n\n<p>To something like this:<\/p>\n\n\n\n<p><code>. back { color : black; background: #d8d8d8 ; font: 8pt verdana ;}<\/code><\/p>\n\n\n\n<p>To control the maximum number of rows on each page of the PDF output, set the max_rows parameter on the Print-Optimized tab in the Application Properties.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>m-Power Reports include the option to output to PDF. The painting for the PDF comes directly from the HTML presentation layer. Therefore, m-Painter is the WYSIWYG editor for HTML, Formatted Excel, and PDF. Options (shown with default) Page Size and Orientation: Portrait (8.5in x 11in) &#8212; (For landscape, use 11in&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[264],"ht-kb-tag":[],"class_list":["post-741","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-deprecated-documentation"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":14,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/741\/revisions"}],"predecessor-version":[{"id":11570,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/741\/revisions\/11570"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/media?parent=741"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=741"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}