Coder Social home page Coder Social logo

Comments (19)

rrthomas avatar rrthomas commented on May 16, 2024

What version of psutils is this? Your example works fine for me with the most recent version, 2.04 (and it should work in any 2.xx version). There's a (passing) test for setting a non-default output paper size in the current version. I also checked outputting Letter size paper, since A4 is the default on my system.

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

I am using psutils 2.03 running on Arch linux 5.9.9. My default paper size is also A4

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

There is an error reported from pstops:

$ psbook printfile.ps psbook.ps
[1] [2] [3] [4] Wrote 4 pages
$ psnup -p A4 -2 psbook.ps fpbooklet.ps
Use of uninitialized value $upto in subtraction (-) at /usr/bin/pstops line 277, line 12554.
[1] [2] Wrote 2 pages

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

Could not attach the postscript file so:
$ pdf2ps printfile.pdf

printfile.pdf

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

Nice choice of file! That particular error is fixed by 2.04, and I confirm that using your attached printfile.pdf with pdf2ps and then running your test, I get A4 output.

I also tried running the test with 2.03. I get the same error as you do (I believe it's harmless by the way), and I again get A4 output.

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

I tried changing my default paper size to Letter, and ran the test, and again I get A4 output. I'm sorry, I'm running out of ideas here.

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

You can attach your original PostScript file by adding the suffix .txt. Could you please attach that and your fpbooklet.ps file?

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

Something is strange here. I attached the file "printfile.pdf". It is a text file from the psnup man page, printed in pdf format.

Here are all the files used, having converted printfile.pdf to printfile.ps, in .zip format:
psnup.zip

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

Thanks. fpbooklet.ps in your Zip file is A4 format.

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

I really do appreciate your time on this!
If I look at the file using ghostscript I get:
ghostscript
If I convert the file to pdf using ps2pdf I get:
fpbooklet.pdf
I have no idea what is going wrong?

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

If I open fpbooklet.ps in gs (I was using evince before), it displays normally. (I'm using GhostScript 9.50 as supplied with Ubuntu 20.04.) Anyway, the DocumentMedia and BoundingBox lines say:

%%DocumentMedia: plain 595 842 0 () ()
%%BoundingBox: 0 0 595 842

which are A4 (divide by 72 and multiply by 2.54!).

The obvious thing that comes to mind is the default paper size configured for your installation of GhostScript; in any case, the output of psutils is clearly correct, so I'm closing the bug. I suggest you add "-sPAPERSIZE=a4" to your invocation of ps2pdf.

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

Thank you for your help and I apologize for my ignorance. :)

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

No problem! It turns out that Debian's ghostscript (and hence Ubuntu's) uses libpaper, so it respects the default system paper size. I guess Arch doesn't do that. You can however set ghostscript's default paper size in gs_init.ps.

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

Alternatively, you've not configured libpaper's default paper size?

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

Thanks - may be not quite so stupid :)

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

Absolutely right. "paper" is set correctly. May be paper should also let libpaper?

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

Thereby hangs a tale! Paper is designed as a replacement for libpaper, and I'm trying to work out how to get there…

from psutils.

AndyM48 avatar AndyM48 commented on May 16, 2024

I suppose you would not consider a rewrite of ghostscript while you are at it? :) :) :)

from psutils.

rrthomas avatar rrthomas commented on May 16, 2024

The idea is to have ghostscript use the new libpaper, indeed.

from psutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.