req.Assets doesn't take filenames with `/` in them (e.g. `images/logo.png`).
titpetric opened this issue · 3 comments
I am upgrading from the Go client from v6 to v7:
I wanted to add a glob("images/*")
which i would then feed to req.Asset; the filename part of issuing gotenberg.NewDocumentFromPath
would be images/logo.png
.
If doing it like this, the rendering fails with "failed to generate the result PDF", and it works if I remove the images/
from the filename path. I suspect because the assets path should be created when adding it, and there's an os.Mkdir missing in gotenberg somewhere.
I am using the 6.2 docker image with this.
Hello @titpetric
Actually the filename should not be a path (aka images/logo.png
) but the filename and its extension only (e.g logo.png
). See https://thecodingmachine.github.io/gotenberg/#html.assets
Good enough, would love a panic or error somewhere if that happens, as it should be an easy check to do.
Just reopening if this behaviour can be improved ...