-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Infinite recursion with some PDF inputs #57
Comments
And I simply can't get
This gives me |
I'm sorry you're having trouble with PSUtils. To take your points in order:
|
By the way, a workaround for the missing man pages: the output of |
Thanks for the very quick response.
I'd tried |
Yes, I only package PSUtils for PyPI.
I can't reproduce this, so sounds like it's file-specific; please can you supply a failing test case? Or failing that, some of the traceback; presumably it's obvious whether the recursion is in psutils or pypdf? |
I've fixed the two bugs you uncovered in git. If you can test from git (see |
OK, I've tried this, and psnup is failing in a different way. Steps:
My test file, generated by Typst (an emerging replacement for LaTeX) is: |
Thanks for this. Re libpaper, you should be able to install that with brew, no need to install it from source. I can reproduce the crash with your test file, many thanks. I'll look into it. |
The endless recursion is inside pyPDF, so it looks like a pyPDF bug; I'll see if I can work up a suitable issue report for that project. |
A workaround in cases like this: convert your PDF to PostScript with |
[Apologies, I accidentally edited this comment instead of quote-replying. I have tried to restore it as it was.—@rrthomas] Thanks for this. Re libpaper, you should be able to install that with brew, no need to install it from source. Confirmed I can install that way. The README doesn't mention the brew option, AFAICS.
Nice.
I confirm the |
Indeed, I can't control/track downstream packages.
That's a hazard of conversion.
You can try setting the page size explicitly: psutils tries to read the page size from the PostScript, but may not succeed. |
Another tip: I accidentally discovered that I was using |
I did, as I showed above: "the Or is there a different way to "set page size explicitly"? More to the point, psbook seems to be detecting and keeping A4 size, but psnup seems not to be, from the output of psbook.
Sorry, I can't tell which you find to be the faster: gs or poppler? |
Sorry, I didn't read your message carefully enough. However, you might well need to set both input and output page size to get it to work.
Poppler. |
Thanks.
Incidentally, psbook seems to be detecting and keeping A4 size, but psnup seems not to be ... (I've not got as far as pstops.) |
If you could make a separate bug report for this issue, that would be super! |
I have retitled this bug to track the pypdf bug. |
Happy to note that the upstream bug has now been fixed. I will make a new release of PSUtils as soon as they do! |
Thanks. Here are my test findings (still on macOS 13.5.2 and python 3.11.4):
|
Looks like you're not using pypdf 3.16. Also, you have a $ PYTHONPATH=. python -m psutils.command.psbook test.pdf testbook.pdf
[*] [1] [2] [*] [10] [3] [4] [9] [8] [5] [6] [7]
Wrote 12 pages
$ PYTHONPATH=. python -m psutils.command.psnup -2 testbook.pdf testnup.pdf
[1,2] [3,4] [5,6] [7,8] [9,10] [11,12]
Wrote 6 pages |
When you install with
Again, works fine for me. If you'd like to pursue this one, please comment on issue #58. |
How can I force it to get 3.16? |
|
Great! Happy to help, and a pypdf contributor did the crucial work here, along with you by reporting the bug in the first place. |
Gotcha. |
Yes, I was just about to point out that to test a release, best to let |
Apologies if this is the wrong place to report this.
I have just found your project to replace pdfbook and pdfnup as I'm moving away from LaTeX to Typst.
I was delighted to find it was available via brew, and appeared to install v3.0.9 without issue on my macOS 13.4.1 machine.
However,
man pdfbook
etc. return "No manual entry for pdfbook". As the README here doesn't include any usage, I was reduced to reading the code to find the args. I'm not sure why this is missing.psbook
works as expected.But
psnup -2 <file>
produces lots of errors:I'm nopsbook and psnup are both in /usr/local/bin/ and are in the PATH.
The text was updated successfully, but these errors were encountered: