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

Can I convert docx from Buffer? #15

Closed
shaharsol opened this issue May 26, 2020 · 2 comments
Closed

Can I convert docx from Buffer? #15

shaharsol opened this issue May 26, 2020 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@shaharsol
Copy link

In the Readme it shows how to convert HTML by passing a string. Let's say I have the docx in a Buffer, can I use it to convert to PDF, instead of having to save it to the filesystem only to be able to post it to gotenberg?

@yumauri
Copy link
Owner

yumauri commented May 26, 2020

Yes, sure! Source can be Buffer:

const toPDF = pipe(
  gotenberg('http://localhost:3000'),
  convert,
  office,
  please
)

// --- 8< ---

const buffer = ...
const pdf = await toPDF({ 'document.docx': buffer })

@yumauri yumauri added the documentation Improvements or additions to documentation label May 29, 2020
@yumauri yumauri self-assigned this May 29, 2020
@yumauri
Copy link
Owner

yumauri commented May 30, 2020

I've added few lines to README file, with example of streaming downloaded file to Gotenberg, without saving it to the disk.

@yumauri yumauri closed this as completed May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants