export existing document with included image (base64) to pdf

Stimulsoft Reports.JS discussion
Post Reply
mskoeries
Posts: 5
Joined: Fri Oct 04, 2019 1:16 pm
Location: Hamburg, Germany

export existing document with included image (base64) to pdf

Post by mskoeries »

Hallo,
we want read saved documents, export to pdf and send the data to the client (because the docuemnt text in browser is not complete). The .mdc document was created with die .net version of Stimulsoft Reports (see attachment).
My code:
var fs = require('fs'),
sr = require('stimulsoft-reports-js');

fs.readFile(path, (err,data)=>{
if (err) throw err;
sr.Base.StiLicense.loadFromFile('./app/license.key');
var report = new sr.Report.StiReport();
report.loadDocument(new Uint8Array(data));
var settings = new sr.Report.Export.StiPdfExportSettings();
var service = new sr.Report.Export.StiPdfExportService();
var stream = new sr.System.IO.MemoryStream();

service.exportPdf(report, stream, settings);
var bytes = stream.toArray();
var result = sr.System.Convert.toBase64String(bytes);

//send result via websocket
});
But I get a very wrong result. Please help.
Thanks in advance.
Attachments
pdfresult.PNG
pdfresult.PNG (72.28 KiB) Viewed 1985 times
000000192949.mdc
(87.7 KiB) Downloaded 114 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: export existing document with included image (base64) to pdf

Post by Lech Kulikowski »

Hello,

Please send us your mdc file for analysis.

Thank you.
mskoeries
Posts: 5
Joined: Fri Oct 04, 2019 1:16 pm
Location: Hamburg, Germany

Re: export existing document with included image (base64) to pdf

Post by mskoeries »

...see attachement "000000192949.mdc" please.

Best regards
Michael
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: export existing document with included image (base64) to pdf

Post by HighAley »

Hello, Michael.

There is no visual part in node.js.
There is no access to the font files too.

So you should add fonts to a special collection.
Please, read this article:
https://stimulsoft.zendesk.com/hc/en-us ... PDF-export

Thank you.
Post Reply