Skip to content

Getting unsupportedFile Error #1

@polp6880

Description

@polp6880

Hi,

I'm trying to use this library on top of file2html and I'm having some issues with it.

I followed this example closely as this is very similar to what I want to achieve but when it comes to using the file2html-pages library, I get this error:

file2html.errors.unsupportedFile

This is the code I currently have:

const file2html = require('file2html');
const OOXMLReader = require('file2html-ooxml').default;
const PagesReader = require('file2html-pages').default;

file2html.config({
  readers: [
    OOXMLReader,
    PagesReader
  ]
});

const fileBuffer = fs.readFileSync(file);
const meta = {
  mimeType: metadata.mimeType // this has a value of 'application/x-iwork-pages-sffpages'
};

file2html.read({
  fileBuffer,
  meta
}).then((file) => {
  console.log('result:', file);
}).catch(console.error);

I tried converting a .docx file with OOXMLReader and this works great but I cannot get it to work using a .pages document. I even tried using the sample .pages files you have in the test directory but I still can't get past that error.

Any help would be greatly appreciated!

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions