PDF-utils with custom font causes undefined Name error



  • Hello folks,

    I have JSReport running on a docker container and using a template on the pug engine with the chrome-pdf recipe. I've been trying to figure out a way that I can sign the pdf with a certificate but when I configure it via pdf-utils (or pdf-sign), I get an error with the message "A Name cannot be undefined".

    Error: Error while executing pdf-utils operations. A Name cannot be undefined
    at module.exports (/app/node_modules/jsreport-core/lib/util/createError.js:11:13)
    at Reporter.createError (/app/node_modules/jsreport-core/lib/reporter.js:332:12)
    at AsyncFunction.<anonymous> (/app/node_modules/jsreport-pdf-utils/lib/main.js:382:22)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    caused by: Error: A Name cannot be undefined
    at new PDFName (/app/node_modules/jsreport-pdfjs/lib/object/name.js:14:13)
    at Function.parse (/app/node_modules/jsreport-pdfjs/lib/object/name.js:109:12)
    at Object.exports.parse (/app/node_modules/jsreport-pdfjs/lib/object/value.js:20:30)
    at Function.parse (/app/node_modules/jsreport-pdfjs/lib/object/dictionary.js:80:30)
    at Object.exports.parse (/app/node_modules/jsreport-pdfjs/lib/object/value.js:20:30)
    at Function.parseInner (/app/node_modules/jsreport-pdfjs/lib/object/object.js:85:28)
    at Function.parse (/app/node_modules/jsreport-pdfjs/lib/object/object.js:73:27)
    at parseObject (/app/node_modules/jsreport-pdfjs/lib/object/reference.js:128:22)
    at PDFReference.get [as object] (/app/node_modules/jsreport-pdfjs/lib/object/reference.js:15:17)
    at Function.addObjectsRecursive (/app/node_modules/jsreport-pdfjs/lib/parser/parser.js:61:35)

    It seems like this could be caused by a custom google font I'm using called Inconsolata.
    CSS here: https://www.cssfontstack.com/Inconsolata
    If I change it to Arial or Helvetica then the pdf successfully generates but this particular custom font is needed. I have tried to find workarounds for this issue but so far have been unsuccessful so any help would be greatly appreciated. Thanks!



  • Hi,

    would you be able to create a minimal playground demo replicating the error so we can take a look?
    Thank you
    https://playground.jsreport.net/

    Jan


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.