Export to pdf not editable

Stimulsoft Reports.JS discussion
Post Reply
kerrysng
Posts: 1
Joined: Mon Jul 20, 2020 4:47 am

Export to pdf not editable

Post by kerrysng » Mon Jul 20, 2020 6:48 am

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
};
HighAley
Posts: 8299
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to pdf not editable

Post by HighAley » Mon Jul 20, 2020 12:54 pm

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.
Post Reply