[V11] PDF Print BUG - Zoomed IN on PDF View

Without the package -f install will fix rather than force (alternatively use --fix-broken install, is the same). You’ll have to resolve the conflicts in any case, sorry.

Can anyone else try to update to latest v11 release and check if they have the same issue of pdf zoomed in ?

It is confirmed that everyone who will update to latest V11 release with by affected by this pdf issue.
As I asked my dev team to update their local server and they have the same issue now.

Just found out that this issue already has a fix in version-11-hotfix.

https://github.com/frappe/frappe/pull/8675.

So hopefully will get resolved in the next version-11 release.

1 Like

@rohit_w

https://github.com/frappe/frappe/pull/8675.

This hotfix didnt fix all the deployment, tried it on test/development server it fixed the issue but doesnt seem to fix it on production, while there is no changes done in production .

All are on same version of wkhtmltopdf

wkhtmltopdf 0.12.3 (with patched qt)

This issue is there in V12 [ERPNext: v12.1.8 (version-12), Frappe Framework: v12.0.18 (version-12)] as well, I just noticed it. Is this issue resolved in V11?

I think this issue on Github is the same

Not it is partially resolved.
I have like 5 servers and in 2 it is resolved and 3 it is not.

In version 12, I traced it back to v12.0.17, there was changes to frappe/utils/pdf.py to make provision for wkhtmltopdf version update 0.12.5, I fixed the issue by updating wkhtmltopdf to 0.12.5.

On Ubuntu 16.04 server

$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb
$ sudo dpkg -i  wkhtmltox_0.12.5-1.trusty_amd64.deb` 
$ sudo apt -f install

On Ubuntu 18.04 server

$ sudo apt-get install -y software-properties-common && \
sudo apt-add-repository -y "deb http://security.ubuntu.com/ubuntu xenial-security main" && \
sudo apt-get -yq update && \
sudo apt-get install -y libxrender1 libfontconfig1 libx11-dev libjpeg62 libxtst6 \
                           fontconfig xfonts-75dpi xfonts-base libpng12-0 && \
wget "https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb" && \
sudo dpkg -i wkhtmltox_0.12.5-1.xenial_amd64.deb && \
sudo apt-get -f install

This resolved the issue for me I personally tested both, I hope this helps

5 Likes

Thanks Mate.

This helped alot. Looks like it is the upgrade issue from frappe pdf.py.

With this it is confirmed that they’re going to support wkhtmltopdf 0.12.5 only.

Thank you, this also resolved my problem.
One question though, why xenial packages and not bionic?

Even with custom print formats, wkhtmltopdf does not render what you want in print view, therefore it is a pernicious bug.

I have not had luck with the solution to this post anyway.

Hi @Tropicalrambler,

are you observing issues related to “smart-shrinking” or compatibility with wkhtmltopdf? Technically, smart-shrinking could be deactivated from the pdf.py settings but that would make it incompatible with earlier versions (gives an argument error)…

1 Like

I am currently taking a shot at that specific topic= smart-shrinking.

Do you have smart-shrinking disabled?

To be honest, I might not be following the solution properly.

Aside from this I am having issues setting up custom print formats in HTML that insert page breaks automatically as added text grows, whilst respecting a custom header / footer structure. I am checking some of your posts on this topic, as it seems you have solved the issue well:

Not sure if I understand correctly, but the page breaks will be inserted in a hard way (i.e. not after n lines of text)… Let me know where you’re at…

So I figured out the insertion of hard coded page breaks to generate multiple pages using a simple script. Or as kids would say these days: “Achievement unlocked”.

Now I’m trying to figure out how to automatically break page when data no longer fits on it. This is part of a larger project, where I am basically creating basic customized print formats for many paper sizes: US Letter, US Legal, US half Letter, US Junior Legal, A4, A5, A6, A7, B4, B5, B6, C4, C5, C6, Foolscap or “Oficio”, US Envelope sizes, and several others. I already have created all the CSS snippets for all these common sizes. I can render div and elements well on an individual item, and force a page Break.

[EDIT] After posting this reply, I found and tried a solution that is supposed to work wonders for automatic page breaks, yet the pages do not automatically break.

1 Like

Did you find any solution ? If yes, pls update. I am using the said print format but my footer comes when the data has ended and the letterhead also starts leaving around 3-4mm of space.

Thank you, “disable-smart-shrinking”: None in the options of pdf.py works perfect.

You’re welcome :wink: