Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read file from binary (buffer) is missing. #7

Closed
BartusZak opened this issue Nov 17, 2020 · 2 comments
Closed

Read file from binary (buffer) is missing. #7

BartusZak opened this issue Nov 17, 2020 · 2 comments

Comments

@BartusZak
Copy link

I would like to use buffer of a file except url.

eg.

const bufferPdf = Buffer.from(pdfToSave.buffer);

      await pdf2html
        .text(pdfBuffer, (err, html) => {
          if (err) {
            console.error("Conversion error: " + err);
          } else {
            console.log(html);
          }
        })
        .promise();
@61soldiers
Copy link

pdf2html.text() converts a pdf to text according to docs.

@shebinleo
Copy link
Owner

Currently, the library uses the external library Tika to generate HTML or text so we cannot use the buffer. A workaround is to use a file path or save the buffer to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants