{"id":13,"date":"2011-03-06T21:37:22","date_gmt":"2011-03-07T02:37:22","guid":{"rendered":"http:\/\/blogs.visigo.com\/chriscoulson\/?p=13"},"modified":"2011-03-13T18:59:52","modified_gmt":"2011-03-13T22:59:52","slug":"use-jpeg%e2%80%99s-in-reporting-services-if-you%e2%80%99re-going-to-export-to-pdf","status":"publish","type":"post","link":"https:\/\/blogs.visigo.com\/chriscoulson\/use-jpeg%e2%80%99s-in-reporting-services-if-you%e2%80%99re-going-to-export-to-pdf\/","title":{"rendered":"Use JPEG\u2019s in Reporting Services if exporting to PDF"},"content":{"rendered":"<p>I recently made the mistake of using PNG\u2019s for high-resolution background images in SQL Server Reporting Services (2008 R2). I wanted to use PNG\u2019s as they were lossless, supported alpha transparency and actually generated smaller files than JPEG for the images I was using.\u00a0 Unfortunately I ran into these problems when exporting to PDF:<\/p>\n<p><strong>SLOW export to PDF<\/strong><br \/>\nPNG exported to PDF: <strong>17<\/strong> seconds.<br \/>\nJPEG exported to PDF: <strong>2<\/strong> seconds.<br \/>\nGIF\u2019s also take the same ridiculously long amount of time as PNG\u2019s to export to PDF.<\/p>\n<p><strong>No Alpha Transparency Support<\/strong><br \/>\nI was initially planning to have a \u201cDRAFT\u201d watermark appear on the report based on a parameter.\u00a0 I thought an easy way to do that would be to add a PNG with alpha transparency as an additional image object, and show\/hide it as needed. This works great when exporting the report to a TIFF file, but it turns out the PDF renderer does not support transparency:<\/p>\n<figure id=\"attachment_14\" aria-describedby=\"caption-attachment-14\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exporttiff.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-14\" title=\"Alpha transparency exported to TIFF\" src=\"https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exporttiff-300x228.gif\" alt=\"Alpha transparency exported to TIFF\" width=\"300\" height=\"228\" srcset=\"https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exporttiff-300x228.gif 300w, https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exporttiff.gif 364w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-14\" class=\"wp-caption-text\">Alpha transparency exported to TIFF<\/figcaption><\/figure>\n<figure id=\"attachment_15\" aria-describedby=\"caption-attachment-15\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exportpdf.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15\" title=\"Alpha transparency exported to PDF\" src=\"https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exportpdf-300x233.gif\" alt=\"Alpha transparency exported to PDF\" width=\"300\" height=\"233\" srcset=\"https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exportpdf-300x233.gif 300w, https:\/\/blogs.visigo.com\/chriscoulson\/wp-content\/uploads\/2011\/03\/exportpdf.gif 364w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-15\" class=\"wp-caption-text\">Alpha transparency exported to PDF<\/figcaption><\/figure>\n<p>I finally concluded that JPEG\u2019s are the only option if the report is going to be exported to PDF. In order to solve my DRAFT watermark issue, I ended up having to create two versions of each image, one with a draft watermark, one without.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently made the mistake of using PNG\u2019s for high-resolution background images in SQL Server Reporting Services (2008 R2). I wanted to use PNG\u2019s as they were lossless, supported alpha transparency and actually generated smaller files than JPEG for the images I was using.\u00a0 Unfortunately I ran into these problems when exporting to PDF: SLOW [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[11,9,8,7,10,17,14,13,18,16,15,12],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-reporting-services","category-sql-server","tag-alpha","tag-jpeg","tag-jpg","tag-pdf","tag-png","tag-reporting-services-2","tag-size","tag-slow","tag-sql-server-2","tag-sql-server-reporting-services","tag-ssrs","tag-transparency"],"_links":{"self":[{"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":1,"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/posts\/13\/revisions\/27"}],"wp:attachment":[{"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.visigo.com\/chriscoulson\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}