-
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
New version of Gotenberg 🚀 #32
Comments
Hi! |
No problem 😄 thank you for maintaining this library 👍 |
Hello @yumauri 👋 I've added your JavaScript/TypeScript client to the documentation. I hope it brings more folks to your repository 😄 |
Wow, thank you so much :) Wish I had more spare time to work on this client >_< New folks with new issues will definitely push me to it :D For those of you, who will come here from the Gotenberg documentation:Gotenberg 7.x brings new conception of modules, thus, changing convertion URLs, separating them by different modules. pipe(
gotenberg('http://localhost:3000/forms/chromium'),
convert,
html,
please
) Same connection string and approach go for For pipe(
gotenberg(''), // any string here, will be overridden
convert, // it is save to remove this line, if you want
office,
adjust({
// manually adjust endpoint
url: 'http://localhost:3500/forms/libreoffice/convert',
}),
please
) This is until I come up with new nice looking API for Gotenberg 7.x with modules support :) |
Hey, no problem 😁 you spent a lot of time developing this library, that’s the least I can do. Also, no pressure regarding the release of a version that matches all Gotenberg 7.x features. Take your time, and if people really wants Gotenberg 7.x support, they should also help you somehow! Btw, I’ve juste released a new PHP client if you want to take some inspiration: https://github.com/gotenberg/gotenberg-php Thank you for your work 😉 |
@yumauri We rely quite heavily on this library in our product and are really happy that you took the time to write and publish it. |
Using the example above, I have office (file) conversion to PDF working using the demo.gotenberg.dev server. However, I cannot get the chromium url conversion working. This is my code:
I get a 400 Bad Request every time. I've tried playing around with the connection string, but everything else gives 404. So I think I'm hitting the right place, but something else is wrong. I can get it to work with a raw POST request (in Postman) to UPDATE: I can get the raw html option working, just not url version. |
@julianpensionjar Oh, I didn't see that URL conversion in 7th version uses different parameter name, just Unfortunately, there is no ready modifier to rename fields in request, and But as a bit hacky workaround you can write you own modifier and put it in chain: const pdfFromUrl = pipe(
gotenberg(`https://demo.gotenberg.dev/forms/chromium`),
convert,
url,
to({ margins: [0, 0, 0, 0] }), // it is better to remove margins with URL conversion
(request) => {
request.fields.url = request.fields.remoteURL
delete request.fields.remoteURL
return request
},
please,
)
return pdfFromUrl(`http://www.google.com`) |
Thanks - I got it working but needed some extra hacking to make Typescript happy - see below for anyone else needing the double-hacky workaround ;o) Create a new type that extends UrlRequestFields to add url attribute...
Use that type in the modifier...
|
I guess you could simply cast to ;(request.fields as any).url = request.fields.remoteURL |
Any update on when |
Oh. I would hate to say that this library is abandoned, but thing is I don't use it anymore myself. I wrote this library for a project, which was closed and no more in active development. Since then I didn't have an urgent demand to upgrade my library, and I was postponing this with hacks, mentioned above in this thread. I still want to upgrade it though. I saw few other JS clients for Gotenberg, but I still think that API of my client is most beautiful (and most polite, heh). So, I will not mark it as abandoned and deprecated, upgrade is still on a table, but I don't have a roadmap for it. And time, for now, unfortunately... @SanderBlom But your question has resurrected my desire from long stagnation, as I see that someone is interested in my work :) I remember, that I was trying to make library compatible with v6 and v7 both, when v7 was out, but I didn't came up with a nice solution and was frustrated. Now I think it is not necessary to support v6, since it is very old, and one using it can stick with current library version anyways. I'll see, maybe without such restriction things will go smoother. |
@yumauri releasing a new version where you drop support for v6 would work perfectly for us :) |
Hello @yumauri 👋
I've just released version
7.0.0
of Gotenberg 🎉A lot of minor changes, the best if you wish to update your JS/TS client is to head to the new documentation.
Also, I've added your repository to the awesome list 😄 currently, I've marked it as only compatible with Gotenberg 6.x, but do not hesitate to open a PR when your client is compatible with version 7 👍
PS: if you have any questions, please ask them!
The text was updated successfully, but these errors were encountered: