OpenTechStrategies / SimpleBook

A fork of the Collection Extension to print books from MediaWiki instances
1 stars 1 forks source link

Articles with `:` in their title breaks printing #41

Closed slifty closed 3 years ago

slifty commented 3 years ago

An article such as Pants: the story of clothing can be added to a book, but printing will fail.

Let's make sure we support printing these sorts of epic pants stories.

slifty commented 3 years ago

I am actually not able to reproduce this issue... at the very least, : titles are working fine.

I'm seeing a single error in the logs:

Error: A Name cannot be undefined
    at new PDFName (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/name.js:6:13)
    at Function.parse (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/name.js:94:12)
    at Object.exports.parse (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/value.js:20:30)
    at Function.parse (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/dictionary.js:74:30)
    at Object.exports.parse (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/value.js:20:30)
    at Function.parseInner (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/object.js:80:28)
    at Function.parse (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/object.js:68:27)
    at parseObject (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/reference.js:128:22)
    at PDFReference.get [as object] (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/object/reference.js:15:17)
    at Function.addObjectsRecursive (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/parser/parser.js:68:35)
(node:15500) UnhandledPromiseRejectionWarning: Error: Invalid PDF: startxref not found
    at Parser.parse (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/parser/parser.js:16:13)
    at new ExternalDocument (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdfjs/lib/external.js:17:12)
    at PDFMerger._addEntireDocument (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdf-merger-js/index.js:36:17)
    at PDFMerger.add (/home/deploy/simplebook/services/api/mw2pdf/node_modules/pdf-merger-js/index.js:11:12)
    at /home/deploy/simplebook/services/api/mw2pdf/built/main.js:432:36
    at Array.forEach (<anonymous>)
    at Function.generateMergedPdf (/home/deploy/simplebook/services/api/mw2pdf/built/main.js:432:14)
    at MediaWikiSession.makePdfBooklet (/home/deploy/simplebook/services/api/mw2pdf/built/main.js:363:67)
    at async Command.<anonymous> (/home/deploy/simplebook/services/api/mw2pdf/built/main.js:857:5)
    at async Promise.all (index 0)

But it doesn't seem to be related to a colon and I can't quite reproduce that either.

I'm going to keep this issue open in case I find this again while working on the other issues.

slifty commented 3 years ago

Haven't seen this again -- closing it for now.