-
Notifications
You must be signed in to change notification settings - Fork 9
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 a remote docx (on s3) to PDF? #14
Comments
(You don't have to save document to the filesystem, if you don't want to — you can use Buffer or ReadableStream) |
BTW to clarify, why you get 404: Functions like const toPDF = pipe(
gotenberg('http://localhost:8008'),
convert,
url,
office,
set(filename('result.pdf')),
please
) you get URL
and this is not a valid Gotenberg endpoint, of course. Not sure, should I handle such cases in my client somehow, or not... I'll think on it |
I've added few lines to README file, with example of streaming downloaded file to Gotenberg, without saving it to the disk. // you can create this function as a static class field or module local variable,
// there is no need to create it anew for each conversion
const toPDF = pipe(
gotenberg('http://localhost:8008'),
convert,
office,
please
)
// --- 8< ---
const signedUrl = await this.getSignedURL(bucket, docxKey)
// I assume s3 uses HTTPS:
// import https from 'https'
https.get(signedUrl, async (document) => {
const pdfStream = await toPDF({ 'document.docx': document })
// ...
}) I'll leave this issue open for a while, though, because I want to think about handling issues, when you specify multiple conversion types (which is incorrect and should throw an exception). |
Not sure what the syntax would be.
I try
and I always get 404 from Gotenberg as if it wasn't able to fetch the signed url tough it is accessible from curl or browser.
The text was updated successfully, but these errors were encountered: