Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RDLC Embedded Image Distorted In PDF

I have a very simple RDLC report I've built with a PNG image in the header. After many trials we could not get external images to work with the report in staging and production.

I then embedded the image in the RDLC and deployed the updated file. The image displays in the ReportViewer control fine. However, when using the export functionality of the viewer to get a PDF the image comes out garbled and distorted. It basically looks as if the image was like the Star Wars intro text but repeated vertically till it disappears. This happens both on my test machine and in stage/production.

Is there something I'm not doing correctly with embedding the image? I've thought about seeing if I could MIME encode the image another way and then insert that into the RDLC. Seems stretched to work though.

like image 475
Mike G Avatar asked Feb 04 '11 15:02

Mike G


2 Answers

I just encountered this issue. For me, the PDF you can generate from the SSRS preview showed the PNG just fine. But when i published the report to SharePoint and then managed email subscriptions to send a PDF, that PDF showed the image all screwy (basically tilted image and then repeated vertically). In my case, I was using a PNG file that had a resolution of greater than 4000 x 4000. I resized it to something more like 1200 x 1200 and the PDF from the subscription showed the PNG just fine.

like image 136
Damon Avatar answered Nov 03 '22 10:11

Damon


Figured this out.

It does have to do with the encoding, in a way. It appears that the PNG encoding is doing weird things. I tried JPEG and GIF encodings and both work in the ReportViewer and PDF export. I tried changing to different PNGs (transparency and non-transparent) and had various distortion issues.

It is my suggestion that if using an embedded image with the ReportViewer that will be exported to PDF that you should use GIFs or JPEGs for embedding in your RDLC.

like image 28
Mike G Avatar answered Nov 03 '22 10:11

Mike G