png-Image

Stimulsoft Reports.JS discussion
Post Reply
Lars
Posts: 5
Joined: Wed Feb 07, 2018 12:12 pm

png-Image

Post by Lars »

Hello,
currently I have issues with pdf-rendering of reports using png-images in JS-Reports (Version: 2018.2.1).
The image boxes are empty (with static and dynamic loaded png-images).

Rendering of png in a HTML-view (preview) is working, but then aspect ratio with stretch isn't working there.

But: Pdf-rendering of jpg-images is ok (with static and dynamic loaded jpg-images, with aspect ratio and stretch, and in HTML-preview too).

Thank you
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: png-Image

Post by HighAley »

Hello.

Sorry, we can't reproduce your issue on our latest build.
Could you upgrade to our latest build?
If you still get the issue, please, send us a sample that will help us to reproduce the issue.

Thank you.
Lars
Posts: 5
Joined: Wed Feb 07, 2018 12:12 pm

Re: png-Image

Post by Lars »

Hello,
I can see the issue with png in current version too (2018.2.2).

Additional info: If I use the javascript-lib "pdf-js" to show such a bad pdf, then I can see pdf without the png and with additional warnings in Chrome debugger:
Warning: Native JPEG decoding failed -- trying to recover: Error during JPEG image loading
util.js:278 Warning: Unable to decode image: JpegError: JPEG error: SOI not found
util.js:278 Warning: Dependent image isn't ready yet

Perhaps, the png isn't correct embedded in the pdf?

Notes:
- Pdf-build by html-view is working (report -> htmlView -> pdf in browser):
using Stimulsoft.Viewer.StiViewer.renderHtml() and StiReport.print()

- Direct export (report -> pdf) with javascript/typescript is working only with jpg, but NOT with png:
using:

Code: Select all

            let settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
            let service = new Stimulsoft.Report.Export.StiPdfExportService();
            let stream = new Stimulsoft.System.IO.MemoryStream();
            service.exportTo(report, stream, settings);

            let data = stream.toArray(); 
But we need direct export to avoid other issues with html-rendering.
Unfortunately our project is sophisticated and we have no easy sample.

Thank you
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: png-Image

Post by Lech Kulikowski »

Hello,

PDF is supported images in jpg format.
To convert images in the JS version, you should use async method:
service.exportToAsync()

Thank you.
Post Reply