Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Footers cut off in ps file

8 views
Skip to first unread message

Dale Snell

unread,
Feb 27, 2015, 11:17:39 AM2/27/15
to help-gn...@gnu.org
On Fri, 27 Feb 2015 13:08:17 +0000, in message 87fv9rz...@gmail.com,
Rodolfo Medina wrote:

> Do you think the problem concerns only gv and Debian, or can I do
> something within Emacs to work it out? I'm attaching a test ps file,
> in which the page number is half cut off.
>
> Help appreciated.
>
> Rodolfo
>

Hi Rodolfo,

I viewed your test file here with gv and qpdfview, and the page
number showed up just fine. Oddly, emacs' doc-view mode and
claws-mail's PS/PDF viewer both cut off the top line ("test").
Possibly due to the fact that the file is A4 size, while my system
(Fedora 21) is set up for US LETTER.

Hope this helps.

--Dale

--
"Text processing has made it possible to right-justify any idea, even
one which cannot be justified on any other grounds."
-- J. Finnegan, USC.

Rodolfo Medina

unread,
Feb 27, 2015, 12:02:03 PM2/27/15
to help-gn...@gnu.org
Dale Snell <dds...@frontier.com> writes:

> On Fri, 27 Feb 2015 13:08:17 +0000, in message 87fv9rz...@gmail.com,
> Rodolfo Medina wrote:
>
>> Do you think the problem concerns only gv and Debian, or can I do
>> something within Emacs to work it out? I'm attaching a test ps file,
>> in which the page number is half cut off.
>>
>> Help appreciated.
>>
>> Rodolfo
>>
>
> Hi Rodolfo,
>
> I viewed your test file here with gv and qpdfview, and the page
> number showed up just fine.

Yes, in fact it shows up fine also in my old Debian box. Then what might the
problem be? Possibily a bug in latest gv Debian version?

Thanks,

Rodolfo


Dale Snell

unread,
Feb 27, 2015, 3:45:26 PM2/27/15
to help-gn...@gnu.org
Possibly, possibly, though I'd be more likely to suspect something
in your configuration, rather than a bug in qv. FWIW, I'm using
gv v3.7.4.

Have you tried any other PS/PDF viewers? If they work, then it's
quite possible there's a bug in your version of qv. So far I've
tried gv, qpdfview, zathura, Emacs (v24.4.1) doc-view mode, and
Claws-Mail's PS/PDF viewer plug-in. The only ones that don't show
the entire document are the Claws-Mail viewer and, oddly enough,
Emacs' doc-view mode. In both cases, the page number shows up,
but the word "test" at the top of the page is missing. I've no
idea what's causing this. Possibly because I'm running in a US
LETTER environment? I don't know.

Given that your old Debian box works while your new one doesn't,
I'd go through the two of them with a fine-toothed comb. Find out
where things are different. The answer to your troubles should be
there somewhere.

Out of curiosity, what does the papersize(5) command show for your
system? It's possible that your system is defaulting to LETTER
instead of A4, though that seems quite unlikely. I ask because I
had trouble printing from a SuSE system. It turned out that the
system default was A4, which I hadn't expected. I set the default
to LETTER, and all was well.

I don't know how much more help I can be, I'm afraid. I don't
know much about PostScript, or how Emacs handles it, so I'm really
shooting in the dark. To complicate matters further, I'm running
Fedora, rather than Debian. They're just different enough to
cause confusion. To quote Dr. Seaton, "Ideas are avoiding me in
droves."

--Dale

--
Pessimist: The glass is half empty.
Optimist: The glass is half full.
Engineer: The glass is twice as big as it needs to be.

Rodolfo Medina

unread,
Feb 28, 2015, 4:06:46 AM2/28/15
to help-gn...@gnu.org
Dale Snell <dds...@frontier.com> writes:

> On Fri, 27 Feb 2015 17:04:29 +0000, in message 87k2z39...@gmail.com,
> Rodolfo Medina wrote:
>
>> Dale Snell <dds...@frontier.com> writes:
>>
>> > On Fri, 27 Feb 2015 13:08:17 +0000, in message
>> > 87fv9rz...@gmail.com, Rodolfo Medina wrote:
>> >
>> >> Do you think the problem concerns only gv and Debian, or can I do
>> >> something within Emacs to work it out? I'm attaching a test ps
>> >> file, in which the page number is half cut off.
>> >>
>> >> Help appreciated.
>> >>
>> >> Rodolfo
>> >>
>> >
>> > Hi Rodolfo,
>> >
>> > I viewed your test file here with gv and qpdfview, and the page
>> > number showed up just fine.
>>
>> Yes, in fact it shows up fine also in my old Debian box. Then what
>> might the problem be? Possibily a bug in latest gv Debian version?
>>
>> Thanks,
>>
>> Rodolfo
>
> Possibly, possibly, though I'd be more likely to suspect something
> in your configuration, rather than a bug in qv. FWIW, I'm using
> gv v3.7.4.

My version is the same.


> Have you tried any other PS/PDF viewers? If they work, then it's
> quite possible there's a bug in your version of qv. So far I've
> tried gv, qpdfview, zathura, Emacs (v24.4.1) doc-view mode, and
> Claws-Mail's PS/PDF viewer plug-in.

I have Emacs 25.0.50.1, and the problem persists also in its doc-view.


> The only ones that don't show
> the entire document are the Claws-Mail viewer and, oddly enough,
> Emacs' doc-view mode. In both cases, the page number shows up,
> but the word "test" at the top of the page is missing. I've no
> idea what's causing this. Possibly because I'm running in a US
> LETTER environment? I don't know.
>
> Given that your old Debian box works while your new one doesn't,
> I'd go through the two of them with a fine-toothed comb. Find out
> where things are different. The answer to your troubles should be
> there somewhere.

Same the file, different the show.


> Out of curiosity, what does the papersize(5) command show for your
> system? It's possible that your system is defaulting to LETTER
> instead of A4, though that seems quite unlikely. I ask because I
> had trouble printing from a SuSE system. It turned out that the
> system default was A4, which I hadn't expected. I set the default
> to LETTER, and all was well.

I don't have that command: `papersize' on my system.

> I don't know how much more help I can be, I'm afraid. I don't
> know much about PostScript, or how Emacs handles it, so I'm really
> shooting in the dark. To complicate matters further, I'm running
> Fedora, rather than Debian. They're just different enough to
> cause confusion. To quote Dr. Seaton, "Ideas are avoiding me in
> droves."
>
> --Dale

Thanks!

Rodolfo


Dale Snell

unread,
Feb 28, 2015, 9:57:32 AM2/28/15
to help-gn...@gnu.org
On Sat, 28 Feb 2015 09:09:22 +0000, in message 871tla4...@gmail.com,
Rodolfo Medina wrote:

> Dale Snell <dds...@frontier.com> writes:
>
> > Out of curiosity, what does the papersize(5) command show for your
> > system? It's possible that your system is defaulting to LETTER
> > instead of A4, though that seems quite unlikely. I ask because I
> > had trouble printing from a SuSE system. It turned out that the
> > system default was A4, which I hadn't expected. I set the default
> > to LETTER, and all was well.
>
> I don't have that command: `papersize' on my system.

ACK! My apologies; I confused the man pages for the command and
the file. papersize(5) is about the file /etc/papersize;
paperconf(1) is the command that reads and writes it. You should
have it; it appears to have been written for Debian.

I still think the key to finding the source of this problem is in
your two Debian systems. In one, the file displays correctly; in
the other, it doesn't. Find out where they differ for displaying
PostScript; that's where your problem is most likely to be.

--Dale

--
"A proper saute pan should cause serious head injury if brought down
hard against someone's skull. If you have any doubts about which
will dent -- the victim's head or your pan -- then throw that pan
right in the trash." -- Anthony Bourdain, _Kitchen Confidential_

Rodolfo Medina

unread,
Feb 28, 2015, 11:05:24 AM2/28/15
to help-gn...@gnu.org
Dale Snell <dds...@frontier.com> writes:

> On Sat, 28 Feb 2015 09:09:22 +0000, in message 871tla4...@gmail.com,
> Rodolfo Medina wrote:
>
>> Dale Snell <dds...@frontier.com> writes:
>>
>> > Out of curiosity, what does the papersize(5) command show for your
>> > system? It's possible that your system is defaulting to LETTER
>> > instead of A4, though that seems quite unlikely. I ask because I
>> > had trouble printing from a SuSE system. It turned out that the
>> > system default was A4, which I hadn't expected. I set the default
>> > to LETTER, and all was well.
>>
>> I don't have that command: `papersize' on my system.
>
> ACK! My apologies; I confused the man pages for the command and
> the file. papersize(5) is about the file /etc/papersize;
> paperconf(1) is the command that reads and writes it. You should
> have it; it appears to have been written for Debian.

paperconf confirms that on my Debian system - both the brand new one and the
old one - a4 is the default paper format.


> I still think the key to finding the source of this problem is in
> your two Debian systems. In one, the file displays correctly; in
> the other, it doesn't. Find out where they differ for displaying
> PostScript; that's where your problem is most likely to be.


Well, in one there is gv 3.7.4 and page numbers are cut; in the other there is
gv 3.6.5 and the ps file is perfectly displayed. On the other hand, your gv
3.7.4 also shows it up fine, so it could maybe be a problem of Emacs (my new
version is 25.0.50.1) or of Debian. But the Debian list didn't help, so I
don't know how to work it out. It's really annoying.

Thanks,

Rodolfo


Thien-Thi Nguyen

unread,
Feb 28, 2015, 12:53:31 PM2/28/15
to help-gn...@gnu.org
() Rodolfo Medina <rodolfo...@gmail.com>
() Sat, 28 Feb 2015 16:08:01 +0000

Well, in one there is gv 3.7.4 and page numbers are cut; in
the other there is gv 3.6.5 and the ps file is perfectly
displayed. On the other hand, your gv 3.7.4 also shows it up
fine, so it could maybe be a problem of Emacs (my new version
is 25.0.50.1) or of Debian. But the Debian list didn't help,
so I don't know how to work it out. It's really annoying.

Maybe some setting in the environment is the cause of the
weirdness. What does gv(1) (the manpage) say re environment?

--
Thien-Thi Nguyen
GPG key: 4C807502
(if you're human and you know it)
read my lisp: (responsep (questions 'technical)
(not (via 'mailing-list)))
=> nil
signature.asc

Rodolfo Medina

unread,
Mar 3, 2015, 5:35:14 AM3/3/15
to help-gn...@gnu.org
Rodolfo Medina wrote:

> I've been forming, for years, ps files from Emacs with `M-x
> pr-ps-buffer-preview' and `M-x pr-ps-buffer-print' without problems. But
> now, in my brand new Debian system, when I do that, the page numbers in the
> ps file are half cut off.

I have Emacs 25.0.50.1 downloaded and built from git repositories.


Thien-Thi Nguyen <t...@gnu.org> writes:

> Maybe some setting in the environment is the cause of the weirdness.


How can I check that?

Thanks,

Rodolfo


Thien-Thi Nguyen

unread,
Mar 3, 2015, 6:34:09 PM3/3/15
to help-gn...@gnu.org
() Rodolfo Medina <rodolfo...@gmail.com>
() Tue, 03 Mar 2015 10:37:40 +0000

> Maybe some setting in the environment is the cause of the
> weirdness.

How can I check that?

I don't know. It was idle speculation. Since then, i have
looked at stampa.ps as converted to a PNG via:

gm convert stampa.ps stampa.png

and i see that the "half" that is cut off from the footer is the
*upper* half! The footer text is clipped by the footer frame.
So that excludes incorrect bounding box problems (due perhaps to
improper paper size specification) in my mental model. Also
supporting the theory that the paper size is indeed correctly
specified are the stampa.ps lines:

%%DocumentMedia: A4 595 842 0 () ()
%%PageMedia: A4

(where "A4" appears). Thus, there must be something else going
on; paper size is a red herring...

Since i don't even have gv installed on this computer, it looks
like gv cannot be at fault, either.

So, the only thing left is the postscript itself must be wrong.
I see that in:

(setq ps-print-footer t
ps-print-footer-frame nil
ps-top-margin 18
ps-bottom-margin 14
ps-left-margin 12
ps-right-margin 0
ps-print-header nil
ps-show-n-of-n nil
ps-print-footer-frame nil
ps-footer-lines 1
ps-footer-offset 0)

the var ‘ps-print-footer-frame’ is set to nil (twice!), yet
stampa.ps line 217 obstinately reads:

/PrintFooterFrame true def

If you manually change the "true" to "false", then there is no
footer frame and thus there is no footer frame clipping. So the
bug lies in the failure of the Emacs Lisp code to propagate the
Emacs Lisp variable ‘ps-print-footer-frame’ to the postscript
definition of ‘PrintFooterFrame’. Or you could say, "one bug".
Maybe there are others.

But before you file a bug report, are you very sure that you
evaluated the ‘(setq ...)’ form *before* generating stampa.ps?
signature.asc

Rodolfo Medina

unread,
Mar 4, 2015, 10:48:33 AM3/4/15
to help-gn...@gnu.org
Thien-Thi Nguyen <t...@gnu.org> writes:

> () Rodolfo Medina <rodolfo...@gmail.com>
> () Tue, 03 Mar 2015 10:37:40 +0000
>
> > Maybe some setting in the environment is the cause of the
> > weirdness.
>
> How can I check that?
>
> I don't know. It was idle speculation. Since then, i have
> looked at stampa.ps as converted to a PNG via:
>
> gm convert stampa.ps stampa.png
>
> and i see that the "half" that is cut off from the footer is the
> *upper* half! The footer text is clipped by the footer frame.
> So that excludes incorrect bounding box problems (due perhaps to
> improper paper size specification) in my mental model. Also
> supporting the theory that the paper size is indeed correctly
> specified are the stampa.ps lines:
>
> %%DocumentMedia: A4 595 842 0 () ()
> %%PageMedia: A4
>
> (where "A4" appears). Thus, there must be something else going
> on; paper size is a red herring...

Yes...


> Since i don't even have gv installed on this computer, it looks
> like gv cannot be at fault, either.

So it is.


> So, the only thing left is the postscript itself must be wrong.
> I see that in:
>
> (setq ps-print-footer t
> ps-print-footer-frame nil
> ps-top-margin 18
> ps-bottom-margin 14
> ps-left-margin 12
> ps-right-margin 0
> ps-print-header nil
> ps-show-n-of-n nil
> ps-print-footer-frame nil
> ps-footer-lines 1
> ps-footer-offset 0)
>
> the var ‘ps-print-footer-frame’ is set to nil (twice!), yet
> stampa.ps line 217 obstinately reads:
>
> /PrintFooterFrame true def
>
> If you manually change the "true" to "false", then there is no
> footer frame and thus there is no footer frame clipping. So the
> bug lies in the failure of the Emacs Lisp code to propagate the
> Emacs Lisp variable ‘ps-print-footer-frame’ to the postscript
> definition of ‘PrintFooterFrame’. Or you could say, "one bug".
> Maybe there are others.
>
> But before you file a bug report, are you very sure that you
> evaluated the ‘(setq ...)’ form *before* generating stampa.ps?


Many thanks for your help. But no, there's a misunderstanding, my fault. The
above settings are not the ones used for stampa.ps. Instead, stampa.ps had the
only setting:

(setq ps-print-footer t)

and nothing else. Besides, the footer is cut off - its upper half, exactly -
*also without* footer frame, i.e. with footer frame set to `nil'.

It's really a problem because I've always been largely using Emacs and ps-print
package. Also from gv mailing list it seems to turn out the ps file to be
incorrect. It is generated by ps-print, from whose maintainer I didn't yet get
a reply to my message. I really don't know what to do. What do you suggest?

Thanks indeed,

Rodolfo


Rodolfo Medina

unread,
Mar 5, 2015, 4:37:23 PM3/5/15
to help-gn...@gnu.org
Rodolfo Medina <rodolfo...@gmail.com> writes:

> I've been forming, for years, ps files from Emacs with `M-x
> pr-ps-buffer-preview' and `M-x pr-ps-buffer-print' without problems. But
> now, in my brand new Debian system, when I do that, the page numbers in the
> ps file are half cut off. Besides, footers are also cut off when gv opens up
> old ps files created in the above way, even though they're correctly viewed
> by gv within my old Debian box. Here are my settings:
>
> (setq ps-print-footer t
> ps-print-footer-frame nil
> ps-top-margin 18
> ps-bottom-margin 14
> ps-left-margin 12
> ps-right-margin 0
> ps-print-header nil
> ps-show-n-of-n nil
> ps-footer-lines 1
> ps-footer-offset 0
> )
>
> Do you think the problem concerns only gv and Debian, or can I do something
> within Emacs to work it out? I'm attaching a test ps file, in which the page
> number is half cut off.


The problem was worked out just adding to my ps-print settings the following
option:

ps-footer-font-family 'Times

, so it was certainly related to the default footer font family that should be,
I think, Helvetica. So there must be a global problem in my system (Debian
Sid) with that font, although I don't know what and would be curious to know.
It is so also explained why the problem arised as well with old ps-print files
and, as well, when simply using ps2pdf to convert them to pdf format.

Thanks to anyone that helped.

Rodolfo


0 new messages