{"id":741,"date":"2008-02-29T03:45:17","date_gmt":"2008-02-29T09:45:17","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/legacy\/?page_id=741"},"modified":"2014-07-15T08:45:06","modified_gmt":"2014-07-15T13:45:06","slug":"converting-reports-to-pdf","status":"publish","type":"page","link":"https:\/\/www.mrc-productivity.com\/legacy\/deprecated-documentation\/converting-reports-to-pdf","title":{"rendered":"Output Reports to PDF"},"content":{"rendered":"<p><!-- Begin Content --><\/p>\n<h1>Output Reports to PDF<\/h1>\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<p>Options (shown with default)<\/p>\n<ol>\n<li class=\"padleft\">Page Size and Orientation: Portrait (8.5in x 11in) &#8212; (For landscape, use 11in x 8.5in)<\/li>\n<li class=\"padleft\">Outside Border Page Margin (.5 in)<\/li>\n<li class=\"padleft\">Border (thin solid black)<\/li>\n<li class=\"padleft\">Inside Border Page Margin Padding (.0 in)<\/li>\n<li class=\"padleft\">Footer (Page 1 of 100)<\/li>\n<\/ol>\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<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<p>Issues to Consider:<\/p>\n<ol>\n<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>\n<\/ol>\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<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<ol>\n<li class=\"padleft\">Change this<br \/>\n<code>&lt; img src =\"\/mrcjava\/image\/ top.jpg \" border=\"0\" &gt;<\/code><br \/>\nto read this:<br \/>\n<code>&lt; img src =\"\/mrcjava\/image\/ top.jpg \" border=\"0\" \/&gt;<\/code><br \/>\nBy default, there are two images in the mrc header. Be sure to change both of them.<\/li>\n<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>\n<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>\n<\/ol>\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<p><code>. back { color : black; background-image: url(\"\/mrcjava\/image\/back.gif\"); font: 8pt verdana ;}<\/code><\/p>\n<p>To something like this:<\/p>\n<p><code>. back { color : black; background: #d8d8d8 ; font: 8pt verdana ;}<\/code><\/p>\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<p>&nbsp;<\/p>\n<p><!-- End Content --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Output Reports to PDF 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 x [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5724,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-741","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":14,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/741\/revisions"}],"predecessor-version":[{"id":7770,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/741\/revisions\/7770"}],"up":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/5724"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/media?parent=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}