0

I am trying to convert a text file in groff format to PDF, using the following command:

groff -Tps -dpaper=letter -P-letter -P-l -ms foo.ms | ps2pdf - output.pdf

The command works fine and outputs me a PDF file, but the paper size is "a4". I would like to change the paper size to "letter", which is the paper size I need for my document.

I've tried changing the "-dpaper" option to "letter" but that doesn't seem to have any effect on the paper size of the resulting PDF file. I have also tried changing the "-P-letter" option to "-P-usletter", but that hasn't worked either.

Is there a way to specify the paper size as "letter" when converting a groff file to PDF using groff and ps2pdf? Or are there any other steps I need to take to achieve this?

null null
  • 19
  • 1

1 Answers1

1

groff seems to work just fine:

$ groff -Tps -dpaper=a4 -P-pa4  -ms tst.ms > tst.ps
$ grep 'PageSize' tst.ps
%%BeginFeature: *PageSize Default
<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice
$ groff -Tps -dpaper=letter -P-pletter  -ms tst.ms > tst.ps
$ grep 'PageSize' tst.ps
%%BeginFeature: *PageSize Default
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
 

The ps2pdf may cause the problems here. There are multiple versions of ps2pdf, some require a -sPAPERSIZE=letter (the mictex version for example).

Ljm Dullaart
  • 4,273
  • 2
  • 14
  • 31