I am also experiencing issues with trying to load an image when exporting to PDF. The image will load just fine in the viewer, but when I use java script code to export to PDF, the image is missing. I also tried to load the image as a resource, still no luck.
report.render();
var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
var service = new Stimulsoft.Report.Export.StiPdfExportService();
var stream = new Stimulsoft.System.IO.MemoryStream();
service.exportTo(report, stream, settings);
var data = stream.toArray();
var fileName = (report.reportAlias) ? report.reportName : report.reportAlias;
fileName += ".pdf";
(<any>Object).saveAs(data, fileName, "application/pdf");
var content = Stimulsoft.System.IO.Http.getFile(dataObj[0].PictureUrl, true);
var resource = new Stimulsoft.Report.Dictionary.StiResource("Image", "Image", false, Stimulsoft.Report.Dictionary.StiResourceType.Image, content);
report.dictionary.resources.add(resource);
I tried with JPG and with PNG.
Image not showing when Export to pdf from Code
Re: Image not showing when Export to pdf from Code
Hello.
Here is a PDF that we get after the export.
If it's right, please, try our latest build.
Thank you.
Here is a PDF that we get after the export.
If it's right, please, try our latest build.
Thank you.
- Attachments
-
- ExportPdf.pdf
- (223.78 KiB) Downloaded 388 times