PDF Image Quality

Stimulsoft Ultimate discussion
Togo
Posts: 58
Joined: Wed Jun 19, 2013 4:34 am

PDF Image Quality

Post by Togo »

Hello

The image quality of the PDF output from the Report Viewer is pretty poor when compared with the one being shown in Report Viewer itself. Below options have been set for the report viewer (the latest pre-release version has been used):

Code: Select all

p.ImageQuality = 1.0F;
p.ImageResolution = 300;
p.PdfImageCompressionMethod = Stimulsoft.Report.Export.StiPdfImageCompressionMethod.Flate;
p.PdfEmbeddedFonts = true;
The screen on the left is the Report Viewer while the one on the right is the PDF output:
Onscreen
Onscreen
pdfquality.png (10.48 KiB) Viewed 10429 times
The quality for the PDF output is noticeably poorer and the printout is even worse:
Printout
Printout
pdfquality_printout.png (106.26 KiB) Viewed 10429 times
Any ideas on what might be wrong?

Thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: PDF Image Quality

Post by HighAley »

Hello.

If it's an image and you export it with 300 dpi resolution but the original image resolution is different the image could be blurred.
If it's a text then we need to see your sample rendered report for analysis.

Thank you.
Togo
Posts: 58
Joined: Wed Jun 19, 2013 4:34 am

Re: PDF Image Quality

Post by Togo »

Hello

Thanks for your response. That is indeed an image with 300dpi res and the PDF file was obtained via StiWebViewer with the PrintDestination set as PDF. I have also tried to get the output via the ResponseAsPdf but the image quality is also not that good. Would the settings mentioned in previous post applied to the resulting PDF under these cases?

I have also tried to use WebViewerFx to view the same report. The StiWebViewerFxOptions.Print.ImageQuality has been set to high and similar settings has been chosen in the Save as PDF dialog.
Export Options
Export Options
PDF_opt_fx.png (32.76 KiB) Viewed 10402 times
The resulting file is in better quality but the one from the Print to PDF option is actually in worse quality than the previous one obtained via the WebViewer and I guess those print options were not applied.
Sample
Sample
PDF_QualSample.png (19.13 KiB) Viewed 10402 times
How can I setup those settings for the Print to PDF output for WebViewerFx if necessary? For the WebViewer case how can I set up the PDF options if they were not applied to the ResponseAsPdf output?

Thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: PDF Image Quality

Post by HighAley »

Hello.

We will add additional settings to the print to PDF feature.
We will let you know when it will be available.

Thank you.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: PDF Image Quality

Post by Vladimir »

Hello,

We have analyzed in detail this issue and find a solution without adding additional properties.

For WebViewerFx, please add the ReportExport with the following code:

Code: Select all

protected void StiWebViewerFx1_ReportExport(object sender, StiWebViewerFx.StiExportReportEventArgs e)
    {
        if (e.Settings.GetExportFormat() == StiExportFormat.Pdf)
        {
            ((StiPdfExportSettings)e.Settings).ImageQuality = 1f;
            ((StiPdfExportSettings)e.Settings).ImageResolution = 300;
        }
    }
For WebViewer, please try to set the properties you specified earlier on the ASPX page:

Code: Select all

<cc1:StiWebViewer ID="StiWebViewer1" runat="server" PrintDestination="Pdf" ImageQuality="1" ImageResolution="300" />
We tested the viewers with the specified parameters, image quality has been improved.


Thank you.
Togo
Posts: 58
Joined: Wed Jun 19, 2013 4:34 am

Re: PDF Image Quality

Post by Togo »

Hello

Thanks for your suggestions, the resulting PDF looks much better with those settings applied.
I have some questions on the suggested solution for the WebViewerFx though. With the suggested method applied, the output obtained from the Export to PDF option will also be affected and the corresponding Export Settings selected onscreen are ignored which could be confusing.
Is it possible to apply the settings to the Print to PDF output only? If not then is it possible to lock / hide individual settings or the entire settings tab from the PDF Export Settings screen to avoid confusion?
I would also like to know if there is any option for WebViewerFx to limit the print option to PDF only (like the PrintDestination=StiPrintDestination.Pdf option for the WebViewer).

Thanks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: PDF Image Quality

Post by Vladimir »

Hello,

We have added an additional property in StiExportReportEventArgs that will determine you are attempting to print or export:

Code: Select all

if (e.Settings.GetExportFormat() == StiExportFormat.Pdf && e.IsPrinting)
        {
            ((StiPdfExportSettings)e.Settings).ImageQuality = 1f;
            ((StiPdfExportSettings)e.Settings).ImageResolution = 300;
        }
I would also like to know if there is any option for WebViewerFx to limit the print option to PDF only
Currently, you can disable HTML-printing using the option:
StiWebViewerFxOptions.Print.AllowPrintToHtml = false;

We will add a new option to disable Flash printing:
StiWebViewerFxOptions.Print.AllowDefaultPrint = false;


Update will be available in the next prerelease build.

Thank you.
Togo
Posts: 58
Joined: Wed Jun 19, 2013 4:34 am

Re: PDF Image Quality

Post by Togo »

Hello

Thank you for your prompt response, may we know when will the next pre-release build be available?

Thanks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: PDF Image Quality

Post by Vladimir »

Hello,

The next prerelease build should be available at the end of this week.

Thank you.
Togo
Posts: 58
Joined: Wed Jun 19, 2013 4:34 am

Re: PDF Image Quality

Post by Togo »

Hello

Thanks for your help and my initial problem on image quality has been solved. I have a follow up question on WebViewerFX though.
Is it possible to have the same PrintDestination=StiPrintDestination.Pdf function in WebViewerFx as in WebViewer (i.e. Generate PDF file and open the print dialog)?

Thanks
Post Reply