Size of PDF with charts
Posted: Tue Jan 15, 2013 10:40 am
Hallo Support,
we're producing reports dynamically using c# code and templates and then exporting the reports to a MemoryStream. This all works fine. However, when we include charts, the resulting pdfs are pretty large and I'd like to find out if there is a way to reduce the size. I've included an example here. The c# code from the MRT template attached here is used to produce the pdf (see attached example). In this case there is not even any data in the two charts but the pdf file is nevertheless 4.2MB.
To export the rendered report we are using this piece of code:
I chose the ImageQuality and ImageResolution values after quite a lot of experimenting. If I reduce them, the loss of quality in the graphics is noticible for the end user. Is there a way I can reduce the final file size without changing these two values?
Thanks and regards,
John Kitching
we're producing reports dynamically using c# code and templates and then exporting the reports to a MemoryStream. This all works fine. However, when we include charts, the resulting pdfs are pretty large and I'd like to find out if there is a way to reduce the size. I've included an example here. The c# code from the MRT template attached here is used to produce the pdf (see attached example). In this case there is not even any data in the two charts but the pdf file is nevertheless 4.2MB.
To export the rendered report we are using this piece of code:
Code: Select all
var settings = new StiPdfExportSettings();
settings.ImageQuality = 1;
settings.ImageResolution = 300;
settings.Compressed = true;
settings.UserAccessPrivileges = StiUserAccessPrivileges.All;
using (var stream = new MemoryStream())
{
stiReport.ExportDocument(StiExportFormat.Pdf, stream, settings);
return stream.ToArray();
}
Thanks and regards,
John Kitching