You are not logged in.

#1 2025-07-07 02:03:33

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 70

[SOLVED] How to set chromium's Save to PDF to use A4 by default?

Same problem with firefox and AUR's google-chrome from what I can tell. 

Every time I tries to print to PDF it always uses "Letter" paper size by default. Sometimes it remembers to use A4 in subsequent printings after I changed it to A4, but the change doesn't last. Especially if I close and reopen chromium. I don't remember chromium had this annoying behavior a few months ago. And I printed to pdf quite a lot back then. 

I tried adding "a4" line to /etc/papersize. Didn't work. 
I tried adding "LC_PAPER=en_GB.UTF-8" to /etc/locale.conf. Didn't work. (I have run # locale-gen to generate en_GB.UTF-8. And /etc/locale.conf also has "LANG=en_US.UTF-8".)

It doesn't look like there's a setting or flag or config to set A4 as the default paper size for chromium. 

I use XFCE if it matters.

Last edited by E3LDDfrK (2025-07-07 07:23:51)

Offline

#2 2025-07-07 03:36:33

patrick4370
Member
From: Australia
Registered: 2018-07-19
Posts: 6

Re: [SOLVED] How to set chromium's Save to PDF to use A4 by default?

Bring up the Print dialog (Ctrl-P) in Chrome. Select Save as PDF in the Destination dropdown. Under More settings, set your Paper size there.
It's the same for firefox.

https://imgur.com/a/B3SASdG

Last edited by patrick4370 (2025-07-07 03:45:20)

Offline

#3 2025-07-07 06:21:18

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 70

Re: [SOLVED] How to set chromium's Save to PDF to use A4 by default?

Hi, patrick4370. Yes, I did that. And after some time, or after restarting chrome, it reverts back to "Letter".

Offline

#4 2025-07-07 06:31:07

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,272

Re: [SOLVED] How to set chromium's Save to PDF to use A4 by default?

D3LDDfrk wrote:

Sometimes it remembers to use A4 in subsequent printings after I changed it to A4, but the change doesn't last.

https://man.archlinux.org/man/paper.1
What's the output of "papersize"?

Though I'm willing to bet some right arms (not mine) that the information is now somehow obtained through xdk-desktop-portal
Do you have https://archlinux.org/packages/extra/x8 … rtal-xapp/ ?

Offline

#5 2025-07-07 07:23:32

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 70

Re: [SOLVED] How to set chromium's Save to PDF to use A4 by default?

Hi seth,

TL;DR: After trying your suggestion and a restart, the problem is solved.

-----

$ paper
Letter: 8.5x11 in

Content of /etc/papersize for reference:

# Simply write the paper name. See man 1 paper and "paper --no-size --all" for possible values
a4

But reading your man link for "paper", I see that /etc/papersize is no. 4 in priority. I created $XDG_CONFIG_HOME/papersize with "a4" as the only line, and the command "paper" shows the correct setting.

$ paper
A4: 210x297 mm

This doesn't do anything to my problem though. 

I also don't have xdg-desktop-portal-xapp installed. So I installed it, but it doesn't seem to work either.

Then I restarted my laptop, and now it works as expected.

-----

To be clear, I tried

  1. adding "a4" to /etc/papersize

  2. adding "LC_PAPER=en_GB.UTF-8" to /etc/locale.conf

  3. adding "a4" to $XDG_CONFIG_HOME/papersize

  4. installing xdg-desktop-portal-xapp

None of them worked until I restarted just now. So it is possible, one of the earlier attempts is a solution. Just needs a restart or something else. edit: as the comments below said, xdg-desktop-portal-xapp is probably not needed.

Last edited by E3LDDfrK (2025-07-07 07:46:28)

Offline

#6 2025-07-07 07:33:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,272

Re: [SOLVED] How to set chromium's Save to PDF to use A4 by default?

$XDG_CONFIG_HOME/papersize will dominate /etc/papersize but is oc user-specific
Try to remove xdg-desktop-portal-xapp again and reboot and see whether it still works… though since paper returned letter I suspect that change will be relevant

grep -EA2 '^LC_PAPER' /usr/share/i18n/locales/en_GB

still includes i18n?

Offline

#7 2025-07-07 07:45:34

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 70

Re: [SOLVED] How to set chromium's Save to PDF to use A4 by default?

> Try to remove xdg-desktop-portal-xapp again and reboot and see whether it still works

It still works.

The output you asked: 

$ grep -EA2 '^LC_PAPER' /usr/share/i18n/locales/en_GB
LC_PAPER
copy "i18n"
END LC_PAPER

Offline

Board footer

Powered by FluxBB