Skip to content

v8.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 28 Oct 07:42

v8.4.0: 🔍 Scans, Scripts & Web Fonts

I am pleased to announce the release of officeParser v8.4.0! It reads a scan's recognised text as what it is, invisible text laid over a picture, and keeps it invisible when the page becomes a slide or a PDF. It reads Indic scripts and Thai whole from the PDFs LibreOffice makes, keeps a PDF's landscape pages when it becomes a Word or OpenDocument file, and takes the web's font formats, WOFF and WOFF2, for its native PDF engine.


🌟 Key Highlights

1. A scan's text layer stays invisible

Text a PDF draws invisibly (a scan's recognised words, as scanners, OCRmyPDF and Tesseract write them) is marked TextFormatting.invisible. PPTX and ODP output write it fully transparent and both PDF engines draw it unseen, so a scan's slide or page still looks like the scan, with its words there to select and search. Every other output writes it as text.

2. Text placed on its baselines

Each level text run of a PDF has bounds.baseline, and PPTX and ODP output place a page's lines on them: slides from a PDF line up with the page to a fraction of a point.

3. A PDF's pages keep their sizes

A page of another size or orientation starts a section, so DOCX, ODT and RTF output keep each page's size, and LaTeX output its orientation.

4. WOFF and WOFF2 fonts

pdfConfig.fonts and pdfConfig.fallbackFonts take WOFF and WOFF2 files, unpacked to the font each holds and checked in linear time. The README now says which fonts draw ₹, ₽ and emoji.

5. Warnings name their page

A PDF warning about a page carries it as OfficeIssue.page: a picture that could not be extracted, a page that could not be loaded, and the page a budget ran out on.


🔧 What's Fixed

  • No font ends the process or is embedded for viewers to draw nothing. A WOFF2 font made subsetting throw outside the conversion; a font that cannot be read now fails the conversion with PDF_GENERATION_FAILED, naming its option.
  • A character is drawn by the first font that draws it. An empty glyph (a colour emoji font's) is passed over for the next font, or the character is reported lost, where it was drawn blank.
  • Indic scripts and Thai are read whole from PDFs that place each letter cluster apart.
  • Font names are typefaces or none: "Type3", "GlyphLessFont" and generic families are no longer written as a typeface.
  • Japanese, Chinese and Korean text in fonts a PDF does not embed is read, where every character was lost: pdf.js is given its CMaps.
  • JBIG2, CCITT fax and JPEG 2000 pictures are decoded: pdf.js is given its image decoders. pdfCMapUrl and pdfDecoderUrl say where they come from in the browser.
  • A PDF picture that is left out is reported, with its page, where it was left out silently: one that cannot be decoded, and one larger than the new pdfParserConfig.maxImagePixels.
  • RTF output starts each page and slide on a page of its own.
  • An ODT section in columns of its own is set in its columns, without includeBreakNodes.
  • More PDF tables are read right: tagged rows that leave cells out, cells set close together, headers over two lines, merged cells set between rows, and labels with their values.

🛠 Getting Started

npm install officeparser@8.4.0

🔗 Full Changelog: View v8.4.0 details
🔗 Documentation & Visualizer: officeparser.harshankur.com