yumauri / gotenberg-js-client

A simple JS/TS client for interacting with a Gotenberg API
MIT License
111 stars 9 forks source link

index.html covers header.html #22

Closed adame21 closed 3 years ago

adame21 commented 3 years ago

Hello I am sending it like this:

                pdf = await toPDF({"header.html": fs.createReadStream(`${convertPath}header.html`), "index.html": fs.createReadStream(`${convertPath}index.html`)})

and in the resulting pdf I can see the header image I had just barely showing to the left where i put some margins on the config:

            const toPDF = pipe(
                gotenberg(getVariableValue("GOTENBERG_BASE_URL")),
                convert,
                html,
                set({
                    waitTimeout: getVariableValue("ENVIRONMENT") == "dev" ? 30 : 180
                }),
                to({
                    marginTop: margin.top,
                    marginBottom: margin.bot,
                    marginLeft: margin.left,
                    marginRight: margin.right,
                    landscape
                }),
                please
            )

For the record the actual margins used there are 0 bot and top, 0.2 left and right, and I can only see the header.html file I sent barely, and behind the index.html margins. Any way I could make it appear on top? I tried z-index in css no luck.

When I send it through postman directly to the gotenberg container the header.html shows on top.

Thanks

adame21 commented 3 years ago

After messing around with the margins I got it working right. Default values were the best. Thanks!

yumauri commented 3 years ago

Love that kind of issues, which are getting resolved before I even had time to read them 😆

But one thing has caught my eyes though:

When I send it through postman directly to the gotenberg container the header.html shows on top.

@adame21 are you saying you were getting different results using library and Gotenberg API directly? With the same defined margins? That shouldn't be so...

adame21 commented 3 years ago

I was a little too quick to pull the trigger on the issue, sorry Actually the configuration was different by I just didnt notice... Flawless library as far as im concerned :) Thanks.

yumauri commented 3 years ago

Ok, because I already started to think where issue could lay :)