Page 1 of 1

Export to pdf not editable

Posted: Mon Jul 20, 2020 6:48 am
by kerrysng
The pdf export creates a pdf that is not editable. Whenever i try to fill and sign the pdf the following error pops up: Operation failed because Adobe Acrobat encountered an unknown error

I'm exporting to pdf via:

// Stimulsoft Reports module
var Stimulsoft = require('stimulsoft-reports-js');
console.log("Stimulsoft Reports loaded");
Stimulsoft.Base.StiLicense.loadFromFile("./license.key");
// Loading fonts
Stimulsoft.Base.StiFontCollection.addOpentypeFontFile("Roboto-Black.ttf");
console.log("Font loaded");

// Creating new report
var report = new Stimulsoft.Report.StiReport();
console.log("New report created");

// Loading report template
report.loadFile("Crew_Timesheet.mrt");
console.log("Report template loaded");

report.dictionary.databases.clear();
report.regData("timecard", "timecard", event.body);

// Renreding report
report.render();
console.log("Report rendered. Pages count: ", report.renderedPages.count);

// Export to PDF
var pdfData = report.exportDocument(Stimulsoft.Report.StiExportFormat.Pdf);

var base64data = new Buffer(pdfData, 'binary').toString('base64');

var responseBody = {
pdfData: base64data,
item: event
};

Re: Export to pdf not editable

Posted: Mon Jul 20, 2020 12:54 pm
by HighAley
Hello,

In some cases our engine use async methods and the report could not be rendered and exported right this way.
You could find the right methods in this sample:
https://www.stimulsoft.com/en/samples/j ... ort-to-pdf

Thank you.