Page 1 of 4

EMF, SVG or how to reduce PDF size

Posted: Sat Jan 28, 2012 3:42 am
by yoyo
Hello,

I have important question. I use some logo pictures in my report and I need reduce pdf file size. I tried use EMF format, but generated PDF show it like raster and it rapidly increase PDF file size. I also tried use SVG format, but I dont know way how to add this format to PDF.

Please, can you advice me , why EMF logo is converted to raster and how I can show SVG logo in PDF reports with Stimulsoft.

Thank you.

EMF, SVG or how to reduce PDF size

Posted: Mon Jan 30, 2012 5:09 am
by HighAley
Hello.
yoyo wrote:I have important question. I use some logo pictures in my report and I need reduce pdf file size. I tried use EMF format, but generated PDF show it like raster and it rapidly increase PDF file size. I also tried use SVG format, but I dont know way how to add this format to PDF.

Please, can you advice me , why EMF logo is converted to raster and how I can show SVG logo in PDF reports with Stimulsoft.
Unfortunately, PDF doesn't allow include images in different formats, but bitmap images only. So all images are converted to bitmap images.

For work with images we use standard facilities of .NET Framework. So only several types of images may be added to report: bmp, gif, png, jpg, emf.

We use two algorithms for image compression which can be selected in the export settings:
1. Jpeg and deflate.
2. Deflate which better to use with simple images, for example, with vector drawings.

Thank you.

EMF, SVG or how to reduce PDF size

Posted: Thu Apr 19, 2012 7:49 pm
by aaronrc
My boss has asked me about this as well, he doesn't like that the 23 page exported PDF report is 8MB. Just so I have my facts straight is the reason pdf export uses raster images instead of vector ones down to the fact that the .Net libraries used don't support vector images?

EMF, SVG or how to reduce PDF size

Posted: Fri Apr 20, 2012 5:35 am
by HighAley
Hello.
aaronrc wrote:My boss has asked me about this as well, he doesn't like that the 23 page exported PDF report is 8MB. Just so I have my facts straight is the reason pdf export uses raster images instead of vector ones down to the fact that the .Net libraries used don't support vector images?
.Net libraries support only WMF and EMF vector formats.
But PDF format doesn't support direct embedding of any vector images.
There are two ways:
1. convert vector images into bitmap images
2. parse metafile structure to simple primitives and commands.

The second way is technically very difficult and time consuming. We don't have plans to implement it.
So at this moment there is only first solution works.

For adding logo you could use third-part library. For example, iText.

Please, send us your report template (mrt-file) with data or rendered report (mdc-file) for analysis and we'll try to give you guidelines for choosing the export parameters.

Thank you.

EMF, SVG or how to reduce PDF size

Posted: Sun Apr 22, 2012 8:53 pm
by aaronrc
Ok, thanks for the clarification. I'll tweak the pdf export parameters myself to get the file size down.

EMF, SVG or how to reduce PDF size

Posted: Mon Apr 23, 2012 4:07 am
by Ivan
Hello,

Let us know if you need any additional help.

Thank you.

EMF, SVG or how to reduce PDF size

Posted: Fri May 04, 2012 12:47 pm
by Fabio Pagano
I'm interested too in reducing pdf file size. If you find some solution or particular tweaking please post in this thread. Actually i've only found solutions that apply to already generated pdf (so it's not involving StimulReport), for example components that compress pdf but looses data (eg. converting images from color to grayscale or lowering resolution on already generated pdf).

Thank you.

EMF, SVG or how to reduce PDF size

Posted: Mon May 07, 2012 3:56 am
by HighAley
Hello.
Fabio Pagano wrote:converting images from color to grayscale
There are image compression methods other than Jpeg and Flate. In the pdf export settings you could choose Simple Monochrome, Ordered Monochrome, FloydSt.Monochrome.
Please read about it in the 16.9.10 Dither section of the Stimulsoft Reports Universal User Manual. Some of them could decrease size in the number of times.
Fabio Pagano wrote:lowering resolution on already generated pdf
You could set any resolution in the export settings.

Thank you.

Re: EMF, SVG or how to reduce PDF size

Posted: Fri Aug 30, 2013 3:43 pm
by bsilence
Hello,

I'm having this problem. I tried to use the property ImageCompressionMethod to Flate, but instead of decreasing size file, it increases :)
Tried several properties that you mention in the manual when exproting to pdf, but nothing works.
I have only 1 image, so i think that's not what is making my pdf file so big...
I' m out of options, can you help me? Only one page of pdf and i get a size of 169Kb.
Also, if it helps, i'm exporting like this:

//Get report in pdf format
StiPdfExportSettings settings = new StiPdfExportSettings();
settings.UserAccessPrivileges = StiUserAccessPrivileges.PrintDocument;

MemoryStream stream = new MemoryStream();
stiReport.ExportDocument(StiExportFormat.Pdf, stream, settings);

//Get byte[] of the document
documentPDF = stream.ToArray();

Any help would be great :)

Thank you.

Best regards

Bruno Fernandes

Re: EMF, SVG or how to reduce PDF size

Posted: Fri Aug 30, 2013 4:39 pm
by bsilence
In addition to previous post.
Is it possible that this is happening because i'm using business objects?
I'm just firing in all directions :)