Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Topage (page number) issue #3889

Closed
loic911 opened this issue Apr 23, 2018 · 9 comments
Closed

Topage (page number) issue #3889

loic911 opened this issue Apr 23, 2018 · 9 comments

Comments

@loic911
Copy link

loic911 commented Apr 23, 2018

Hi,

Problem
See header in result.pdf.
My pdf pages goes from "Page 1 of 5" to "Page 4 of 5". There is only 4 pages.
Sometimes I get 2 extra invisible pages.

What I expect
"Page 1 of 4" to "Page 4 of 4"

Step to reproduce
Extract this zip containing body, header and footer.html: html.zip

Run
wkhtmltopdf --dpi 300 --disable-smart-shrinking --margin-top 5mm --zoom 1 --header-spacing 35 --footer-spacing 20 --header-html header.html --footer-html footer.html body.html result.pdf

Is it a bug or a bad use?

Thanks :-)

@hakimio
Copy link

hakimio commented Apr 23, 2018

Does it happen if you leave out "dpi" setting?
Which wkhtmltopdf version are you using?

@loic911
Copy link
Author

loic911 commented Apr 23, 2018

Same issue without dpi
Version wkhtmltopdf 0.12.4 (with patched qt)

@myself379
Copy link

myself379 commented Apr 25, 2018

I had the same issue, I did not use the --dpi settings as it screwed up the words, especially if the sentences is in between pages. I use --disable-smart-shrinking because it corrects itself to 14px font-size. Most of the time I get the correct number of [page] and [toPage]. But in quite a numbered occasion the [toPage] has extra 1 page.

For my case, it show 11 / 12, even though the last page is page 11.

I'm using 0.12.4 (wkhtmltox-0.12.4_linux-generic-amd64.tar.xz for production server).

However, on my local machine 0.12.4 (wkhtmltox-0.12.4_mingw-w64-cross-win64.exe) the [toPage] is rendered correctly as 11 page.

Both are using same source of code base (Laravel), and I'm pushing using git from local machine to local repo and then to production for deployment.

@Tomsgu
Copy link
Contributor

Tomsgu commented Oct 18, 2018

This should be fixed in #3952. Can you try it with 0.12.6 version (not released yet)?

@stmlange
Copy link

Is there any public version of 0.12.6 available or do I need to build from source myself?

(Note: since travis already seems to tests the build could it perhaps publish the artifacts too? (see https://docs.travis-ci.com/user/deployment/releases/ perhaps just publish it with prerelease: true)

@ashkulz
Copy link
Member

ashkulz commented Nov 19, 2019

@stmlange: you can build 0.12.6 yourself, it's quite easy -- see the packaging repository. You can also try an older dev build -- I'll try to have it updated by this weekend.

@beyondcreed
Copy link

beyondcreed commented Feb 4, 2020

Hi,

We are needing this on production FreeBSD system. However the official latest package version is: 0.12.5_5. Any chance you can make a public release so port maintainer can update it. I think they may be waiting for official release before updating the port. Otherwise we will need to look into building from source. Thanks.

https://www.freshports.org/converters/wkhtmltopdf/

@stmlange
Copy link

stmlange commented Feb 4, 2020

See the discussion in #4578

Perhaps you could try to install the latest pre-release from https://github.com/wkhtmltopdf/packaging/releases/

@ashkulz
Copy link
Member

ashkulz commented Jun 7, 2020

A release candidate for the 0.12.6 release is now available for download, which should contain changes which possibly address this issue.

Would appreciate downloading the package and reporting back if any issues are encountered during testing. Assuming all goes well, I plan to release 0.12.6 on the 2-year anniversary of the previous release i.e. June 11, 2020.

@ashkulz ashkulz closed this as completed Jun 7, 2020
@ashkulz ashkulz added Duplicate and removed NeedInfo labels Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

7 participants