Hi,
We have problem with the pdf-utils pdfCreatePagesGroup method. On our local machine on windows, it works without problem but on our dev or production environment running on linux, the group is never created.
We have some log showing the $pdf.pages object on our windows machine vs our linux machine using the same code :
windows:
// console.log(this.$pdf.pages):
Object [
{ group: undefined, items: Object [] },
{ group: { name: 0 }, items: Object [] },
{ group: { name: 0 }, items: Object [] }
]
linux:
// console.log(this.$pdf.pages):
Object [
{ group: undefined, items: Object [] },
{ group: undefined, items: Object [] },
{ group: undefined, items: Object [] }
]
The code to create the group:
{{#each items}}
{{{pdfCreatePagesGroup name=4}}}
...
{{/each}}
We did some debugging and the <span> with the group information is outputted to the document on both windows and linux as per this log line:
Pdf utils adding group hidden field <span style='opacity: 0.01;font-size:1.1px'>group@@@eyJuYW1lIjowfQ==@@@</span>
We noticed that on windows we have the following log line, but not on linux:
Pdf utils invokes merge with group [object Object]
We followed the code on where this line is logged and we think the problem either comes from the getPageText() call or the parseGroup() function in https://github.com/jsreport/jsreport-pdf-utils/blob/master/lib/utils/parsePdf.js
We are using the ChromePdf recipe and the handlebars engine.
We are running the latest nuget packages available (jsreport.AspNetCore 2.0.0, jsreport.Local 2.0.0, jsreport.Binary.Linux 2.2.2, jsreport.Binary 2.2.0). Here is the code we use in the startup.cs :
var jsReport = new LocalReporting()
.UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? jsreport.Binary.JsReportBinary.GetBinary() : jsreport.Binary.Linux.JsReportBinary.GetBinary())
.RunInDirectory(RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "jsreport" : null)
.KillRunningJsReportProcesses()
.Configure(config => config.AllowedLocalFilesAccess().FileSystemStore())
.AsWebServer()
.Create();
services.AddJsReport(jsReport);
jsReport.StartAsync().Wait();
Do you have any idea what could cause the group to be undefined on linux?
Thanks