How do I create a blank PDF from the command line?

Brian Fitzpatrick

I recently needed a single blank PDF page (8.5" x 11" size) and realized that I didn't know how to make one from the command line.

Issuing touch blank.pdf produces an empty PDF file. Is there a command line tool that produces an empty PDF page?

BartekChom

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.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How do you create an empty file from the command line in Windows

분류에서Dev

How can I create a file with a specific size from a command line?

분류에서Dev

How can I create a message box from the command line?

분류에서Dev

How do I install the latest version of cmake from the command line?

분류에서Dev

How do I start tty from the command-line?

분류에서Dev

How do I run a gui app from the command line?

분류에서Dev

How can I remove the last blank line of a wmic command?

분류에서Dev

How do I get information from the logs on my computer when I only have access to the command line?

분류에서Dev

How to print a regular file to pdf from command line

분류에서Dev

Command line tool to create a pdf file with a4 sized pages from a poster pdf

분류에서Dev

How do I list all installed packages from the command line in bash / osX

분류에서Dev

How can I do disk surface scanning, and fix/reallocate bad sectors in Linux from the command line?

분류에서Dev

How do I delete all empty directories in a directory from the command line?

분류에서Dev

How to create a user for Postgres from the command line for bash automation

분류에서Dev

How do I boot to a command line interface instead of a GUI?

분류에서Dev

How do I edit previous lines in a multiple line command in Bash?

분류에서Dev

How do I zip up multiple files on command line?

분류에서Dev

In Linux, how do I truncate command-line output?

분류에서Dev

How do I copy the directory and its folders in windows command line?

분류에서Dev

How do I get a list of running applications by using the command line?

분류에서Dev

How do you select the fastest mirror from the command line?

분류에서Dev

How can I preview HTML documents from the command line?

분류에서Dev

How can I retrieve the Session ID from command line?

분류에서Dev

How can I invoke a user switch from the command line?

분류에서Dev

How can I create an XFDF file from a PDF?

분류에서Dev

How do I insert a line at the top of a text file using the command line?

분류에서Dev

How do I delete a page from a PDF in Okular?

분류에서Dev

Command line PDF reader

분류에서Dev

How do I run an arbitrary shell command from Deno?

Related 관련 기사

  1. 1

    How do you create an empty file from the command line in Windows

  2. 2

    How can I create a file with a specific size from a command line?

  3. 3

    How can I create a message box from the command line?

  4. 4

    How do I install the latest version of cmake from the command line?

  5. 5

    How do I start tty from the command-line?

  6. 6

    How do I run a gui app from the command line?

  7. 7

    How can I remove the last blank line of a wmic command?

  8. 8

    How do I get information from the logs on my computer when I only have access to the command line?

  9. 9

    How to print a regular file to pdf from command line

  10. 10

    Command line tool to create a pdf file with a4 sized pages from a poster pdf

  11. 11

    How do I list all installed packages from the command line in bash / osX

  12. 12

    How can I do disk surface scanning, and fix/reallocate bad sectors in Linux from the command line?

  13. 13

    How do I delete all empty directories in a directory from the command line?

  14. 14

    How to create a user for Postgres from the command line for bash automation

  15. 15

    How do I boot to a command line interface instead of a GUI?

  16. 16

    How do I edit previous lines in a multiple line command in Bash?

  17. 17

    How do I zip up multiple files on command line?

  18. 18

    In Linux, how do I truncate command-line output?

  19. 19

    How do I copy the directory and its folders in windows command line?

  20. 20

    How do I get a list of running applications by using the command line?

  21. 21

    How do you select the fastest mirror from the command line?

  22. 22

    How can I preview HTML documents from the command line?

  23. 23

    How can I retrieve the Session ID from command line?

  24. 24

    How can I invoke a user switch from the command line?

  25. 25

    How can I create an XFDF file from a PDF?

  26. 26

    How do I insert a line at the top of a text file using the command line?

  27. 27

    How do I delete a page from a PDF in Okular?

  28. 28

    Command line PDF reader

  29. 29

    How do I run an arbitrary shell command from Deno?

뜨겁다태그

보관