Page 1 of 1

export existing document with included image (base64) to pdf

Posted: Fri Oct 04, 2019 1:52 pm
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.

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

Posted: Mon Oct 07, 2019 10:17 am
by Lech Kulikowski
Hello,

Please send us your mdc file for analysis.

Thank you.

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

Posted: Mon Oct 07, 2019 10:32 am
by mskoeries
...see attachement "000000192949.mdc" please.

Best regards
Michael

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

Posted: Wed Oct 09, 2019 4:10 pm
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.