convert
, the ImageMagick utility used in Ketan's answer, also allows you to write something like
convert xc:none -page Letter a.pdf
or
convert xc:none -page A4 a.pdf
or (for horizontal A4 paper)
convert xc:none -page 842x595 a.pdf
etc., without creating an empty text file. @chbrown noticed that this creates a smaller pdf file.
"xc:" means "X Constant Image" but could really be thought of as "x canvas". It's a way to specify a single block of a color, in this case none. More info at http://imagemagick.org/Usage/canvas/#solid which is the "de facto" manual for ImageMagick. [supplemented with information from pipe] (Things like pdf:a
can be used to explicitly declare the format of a file. label:'some text'
, gradient:
, rose:
and logo:
seem to be other examples of special file formats.)
Anko suggested posting this modification as a separate answer, so I am doing it.
Best Answer
Yes. The
file
command covers thisTo get greater detail, you could try
pdfinfo
, part of popper-utils.