$ /usr/local/bin/gs GPL Ghostscript 10.01.1 (2023-03-27) Copyright (C) 2023 Artifex Software, Inc. All rights reserved. This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY: see the file COPYING for details. Unknown .defaultpapersize: (Letter). GS> This is on a Fedora 38 system and occurs using the source package compiled from the Ghostscript site. (it also happens using the Fedora package, but I wanted to verify that it also happened using a clean slate).
I think the default paper size comes from the host Ghostscript runs on, via .defaultpapersize <- gp_upapr.c::gp_defaultpapersize() <- [LIBPAPER] systempapername() (if built with LIBPAPER, which makes a lot of sense at least to handle the fact that part of the world wants A4 and [most of] the other part needs letter). So maybe there’s no bug in Ghostscript, but the reporter’s system settings specify ‘Letter’ with inital uppercase. Even if case does not matter for other programs, it matters for PostScript names.
(In reply to SaGS from comment #1) > (if built with LIBPAPER, which makes a lot of sense at least to handle the > fact that part of the world wants A4 and [most of] the other part needs > letter). Yes with a simpler report we had deduced that libpaper was returning a string with 'Letter' rather than 'letter' The man pages I've looked at indicate that libpaper 'prefers' the lower case form but don't specifically say it must be. > So maybe there’s no bug in Ghostscript, but the reporter’s system settings > specify ‘Letter’ with inital uppercase. Even if case does not matter for > other programs, it matters for PostScript names. We discussed making some changes in the C code so that paper sizes would be converted to lower case, there are a few sizes where that will be a problem and we'll need to duplicate those as lower case, so its not totally trivial. In the meantime Michael can presumably change his libpaper setup to 'letter' in /etc/papersize.
OK there is a proposed fix here: https://git.ghostscript.com/?p=user/ken/ghostpdl.git;a=commitdiff;h=4d49dd971aa60029e8eee0e68f818ec02576ba7c but we are unable to test it. Whatever we enter in /etc/papersize libpaper returns a lowercase string. Which suggests that indeed there has been a change in libpaper which is not present in other distributions. Michael could you try applying that patch and see if it solves your problem please ? If it does then I'll commit it to our repository.
Yes, that patch works for me. Thanks. Both the Fedora build and the default build using the configure of Ghostscript on Fedora uses libpaper. On Fedora I do not see /etc/papersize. There is /etc/paperspecs but this is a file of what you might expect ... paper specs.
(In reply to Michael Katzmann from comment #4) > Yes, that patch works for me. Thanks. Great, the RedHat package maintainer offered to run their regression tests for us with that patch, so I'm going to hold off until we hear back. > Both the Fedora build and the default build using the configure of > Ghostscript on Fedora uses libpaper. And Fedora 37 onwards are using libpaper 2.0.x whereas Ubuntu is still using libpaper 1.1.x. This appears to be a change in behaviour with libpaper 2.x > On Fedora I do not see /etc/papersize. There is /etc/paperspecs but this is > a file of what you might expect ... paper specs. Yeah there's also (apparently) user-specific default media in ~/config/papersize. There may be other places, I don't know much about libpaper. Thanks for testing it, once I hear back from RedHat (I don't anticipate a problem but just to be sure) I will push this to the Ghostscript repository.
OK thanks, I'm testing on Fedora 38 beta which is probably why I saw this.
Patch committed as d7ea2428d9db699b8b3e277f629555b3428c6987 we're as confident as possible that this should solve the problem. No matter what libpaper returns we will always turn it into lower case and then match it against the known sizes. Its still possible to have a default media size which we genuinely don't know about of course. Thanks for the report!