-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--paper option ignored #78
Comments
Indeed that seems not to work with the current version of pdfjam (as far as I can tell from a quick try here with 3.10). I am still using pdfjam 3.03 on my computer. The --paper and --a4paper options work fine in that version. I have not tested any other versions than 3.03 and 3.10 for this. So something has got broken between 3.03 and 3.10 it seems. (likely due to one of the "enhancements" that people seem to insist on suggesting?) |
Thanks for checking, @DavidFirth. I'm embarrassed, as this has happened on my watch, so it seems I've been too happy to accept additions. So, I've done some testing. With current git master, if I run
I also tried with In other words, it's working in this case. @DavidFirth, if you can give me a reproducer that fails, I can look into it further. |
Thanks, and please don't feel embarrassed, we're all just doing our bit (and you are doing more than most!) I wonder if it is really working at your end though @rrthomas --- maybe like me you have A4 set as a default somewhere? Have you tried it with the option --a5paper for example? |
Still working:
|
That's odd. As far as I can tell (from
I used the following to attempt A5 output as documented:
No error message. But the resulting output is A4 in both cases (as given by So this is all very puzzling. In case it's relevant, here is my locale data:
|
A last The reason is that After commit b615592, default paper/papersize will be set as if a This might be a cause of the issue. |
A few things: Just want to clarify that my system shows $ paper
Letter: 8.5x11 in based on my locale I'm not sure why this change b615592 was made. I had noticed that in cursory viewing of the pdfjam script as well and wondered if that could be possibly be what was happening... Options provided on the command line must always override anything else specified by other libraries or the environment. Looking more closely the problem seems to be that this commit sets a default Definitely clarify if you are getting working behavior with --papersize a5paper or --paper a5paper. --papersize should only accept a size pair |
So that commit introduces a bug, if I understand correctly. (a bug in the sense that behaviour is no longer as documented) Simplest fix would be to revert it? Maybe there's a better way but I don't know it. |
Issue summary: If |
Suggested fix: Only populate It would also be helpful if |
Indeed it used to be the case that As for the suggested fix: care would be needed to make sure it agrees with the documentation. What if the user or sysadmin has specified a default papersize for |
It should be noted that |
Yet another suggested fix: When processing options
|
I will look at this. Thanks for all your analysis and suggestions, I am confident there's a sensible story to pull together and implement in there when I have a moment to sit down and look at it properly. |
While Simply setting the |
This (lemniscati@f90b102) is a modification for #78 (comment): Make options --paper, --*paper and --papersize override preceding ones. But it is not for modification of |
By the way, according to the current sample pdfjam.conf,
|
OK, I think there are two issues to deal with here:
|
So, about the configuration, I see several references to environment variables such as This means that configuration of paper size has only three sources: first, So in summary, I think fix for this bug is very simple: command-line options should override previous settings. In particular, using So in fact, I am in complete agreement with @lemniscati's solution. @lemniscati, please could you make it a PR? |
I have merged the PR, and also pushed fixes for the output of
|
About 1. It looks ok. About 2. (1) libpaper2 seems relatively new and there are some systems which does not adopted yet. I would not like it to be mandatory. |
Can you explain this please? How would such a command-line option arise? |
Ah, sorry... |
Thanks for doing all this. I can aim to do some checking in the next few days, if that would be helpful. I wonder, @rrthomas can you make a release file (ie, as it would be made based on the current master) and send it to me? Then I would be able to check it all, including checking that |
@DavidFirth I've sent over a build archive. |
pdfjam-findings.md I attach a file here with the results of my checking --- I hope it's all clear enough. I have listed everything, so that you can see what worked as well as some things that did not. The problems I found are labelled BUG1...BUG6. There's also a question at QUERY1. It's not as bad as it looks: BUG4-BUG6 probably all have the same root cause (ie, an unnecessary call to I had intended in addition to do some checking of the I hope it helps! I haven't looked into the code at all (to be honest, I was never expert in shell scripting and I know even less about it now). I hope that it's not too hard to fix the problems I found. If you need any more checking from me, do let me know. |
Thanks for this, @DavidFirth. I'll have a look when I can. |
I have fixed BUG1 ( I have responded to QUERY1 by documenting the ultimate fallback paper size of A4 in |
I have added a sanity check for the output of |
I have fixed BUG3 by clarifying the documentation for |
I believe I have now fixed the remaining bugs, by adopting your suggestion @DavidFirth. I would also like to commit your test procedure, if I may. I think it would be quite easy to adapt |
Thanks, yes that's fine by me. Would you like me to do further testing now before making a release? (it would need to be at the weekend, because I'm away in the next 2 days) |
Yes please! |
As it stands in the modified output of Related: I myself am unsure now exactly what takes precedence on the Also related: the output of |
A few days ago I wrote:
I now have to apologise, because other things at present are limiting severely the time I can spend at the computer. I have not been able to any further checking beyond looking at the |
No worries, @DavidFirth; I will take your recent comments into account then make a release. |
There is, hence the phrase "In the absence of any other setting". But I agree that that could be taken to mean "pdfjam setting", so I'll clarify.
In common with many other command-line programs, last option wins. This allows in particular straightforward programmatic use of pdfjam, where the command line is generated by another program.
It can't be set in the configuration, but it can get a default value from libpaper (recall, this is because libpaper knows about paper sizes that Again, I'll clarify the wording here. |
I have released version 3.11. I will close this issue; of course, there may be others! |
pdfjam version: 3.10 (arch linux, texlive-binextra 2024.2-1)
Is it just me or is the --paper option (both
--paper a4paper
and--a4paper
) completely ignored? As well as/etc/papersize
as suggested by libpaper..The only way I can get pdfjam to output A4 sized pages instead of defaulting to letter (even with A4 sized inputs!!) is with
which is obviously not ideal.
What am I missing?
The text was updated successfully, but these errors were encountered: