GroupDocs.Conversion for Node.js via Java 23.11 Release Notes
Major Features
There are 8 features and bug fixes in this release:
- Improved file type detection algorithm.
- Added lzma format detection from input stream.
- Fixed CSV and text to PDF conversion from input stream.
- Fixed IFC to JPG conversion issue.
- Fixed Word with Macros files conversion.
- Fixed setFontDirectories method modifier.
- Improved stability of work with some kinds of documents.
- Added simplified public api to process document from stream
Full List of Issues Covering all Changes in this Release
| Key | Category | Summary | 
|---|---|---|
| CONVERSIONNODEJS‑108 | Fix | Java Conversion to PDF from text and CSV file do not generate PDF document | 
| CONVERSIONNODEJS‑109 | Fix | IFC to JPG conversion issue | 
| CONVERSIONNODEJS‑110 | Fix | Issue in converting Word file with Macros to JPG | 
| CONVERSIONNODEJS‑111 | Fix | setFontDirectories() method has a private access in ConverterSetting class | 
| CONVERSIONNODEJS‑112 | Fix | Seek to the documentStream origin after using in Document | 
| CONVERSIONNODEJS‑113 | Improvement | Simplify public api to process document from stream | 
Processing documents from stream simplified
Product public API provides easy and convenient readDataFromStream method to process documents from stream.
The following code snippet shows the method implementation and usage examples:
exports.readDataFromStream = function (readStream) {
  return new Promise((resolve, reject) => {
    const inputStreamBuffer = new exports.StreamBuffer()
    readStream.on('data', chunk => {
      inputStreamBuffer.write(chunk)
    })
    readStream.on('end', () => {
      try {
        resolve(inputStreamBuffer.toInputStream())
      } catch (err) {
        reject(err);
      }
    });
  });
}
The following code snippet shows how to set product license provided as stream:
const fs = require('fs')
async function setLicenseFromStream(groupdocs, licensePath) {
    const license = new groupdocs.conversion.License()
    const licenseStream = fs.createReadStream(licensePath)
    const stream = await groupdocs.conversion.readDataFromStream(licenseStream)    
    await license.setLicense(stream)
}
module.exports = setLicenseFromStream
The following code snippet shows how to view source file provided as stream:
const fs = require("fs")
async function loadDocumentFromStream(groupdocs, inputFilePath) {
  const outputPath = `LoadDocumentFromStream.docx`
  try {
    const docStream = fs.createReadStream(inputFilePath)
    const stream = await groupdocs.conversion.readDataFromStream(docStream)
    const converter = new groupdocs.conversion.Converter(stream)
    const convertOptions = new groupdocs.conversion.WordProcessingConvertOptions()
    console.log(`Source document converted successfully to ${outputPath}`)
    return converter.convert(outputPath, convertOptions)
  } catch (error) {
    throw new Error(error)
  }
}
module.exports = loadDocumentFromStream;
Public API and backward incompatible changes
None