pdftopng(1)

πŸ“¦
version 4.06 Β· 3 versions
, in arch rolling, fedora 43, fedora 44, nixpkgs unstable

πŸ’– pdftopng β€” the glow-up your PDFs have been waiting for πŸ’–

okay bestie, sit down, hydrate, and let me tell you about pdftopng, a whole icon from the General Commands Manual collection. it's the PDF-to-PNG converter, version 4.06, and it literally just... does the thing. no cap.


✨ NAME ✨

pdftopng β€” Portable Document Format (PDF) to Portable Network Graphics (PNG) converter (version 4.06)


🌸 SYNOPSIS 🌸

pdftopng [options] PDF-file PNG-root

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: pdftopng takes your Portable Document Format (PDF) files and turns them into color, grayscale, or monochrome image files in Portable Network Graphics (PNG) format. that's the whole main character arc.

it reads the PDF file, PDF-file, and then writes one PNG file for every single page β€” named PNG-root-nnnnnn.png, where nnnnnn is the page number. one page, one file, no skipping, no favorites. πŸ’…

and if PNG-root is -, the image gets sent to stdout instead. ngl though, that's probably only useful when you're converting a single page β€” like, imagine piping a 400-page PDF through there, chaos. πŸ™ˆ


πŸŽ€ CONFIGURATION FILE πŸŽ€

pdftopng reads a configuration file at startup, because it's a little extra like that. first it tries to find your private config file, ~/.xpdfrc. if that one doesn't exist, it goes looking for a system-wide config file β€” typically /etc/xpdfrc (though this location can be changed when pdftopng is built, iykyk).

for all the juicy details, go read the xpdfrc(5) man page. 🫢


πŸ’… OPTIONS πŸ’…

a bunch of these can also be set with configuration file commands β€” those are listed in square brackets next to the matching command line option, so you always know who's who. ✨

  • -f number β€” specifies the first page to convert.
  • -l number β€” specifies the last page to convert.
  • -r number β€” specifies the resolution, in DPI. the default is 150 DPI.
  • -mono β€” generate a monochrome image (instead of a color image).
  • -gray β€” generate a grayscale image (instead of a color image).
  • -alpha β€” generate an alpha channel in the PNG file. this is only useful with PDF files that have been constructed with a transparent background. also, important: the -alpha flag cannot be used with -mono. pick a lane, babe. 😭
  • -rot angle β€” rotate pages by 0 (the default), 90, 180, or 270 degrees.
  • -freetype yes | no β€” enable or disable FreeType (a TrueType / Type 1 font rasterizer). this defaults to "yes". [config file: enableFreeType]
  • -aa yes | no β€” enable or disable font anti-aliasing. this defaults to "yes". [config file: antialias]
  • -aaVector yes | no β€” enable or disable vector anti-aliasing. this defaults to "yes". [config file: vectorAntialias]
  • -opw password β€” specify the owner password for the PDF file. providing this will bypass all security restrictions. (slay, but also, respectfully, use this power wisely πŸ”₯)
  • -upw password β€” specify the user password for the PDF file.
  • -verbose β€” print a status message (to stdout) before processing each page. [config file: printStatusInfo]
  • -q β€” don't print any messages or errors. silent treatment, but make it functional. [config file: errQuiet]
  • -cfg config-file β€” read config-file in place of ~/.xpdfrc or the system-wide config file.
  • -v β€” print copyright and version information.
  • -h β€” print usage information. (-help and --help are equivalent.)

⭐ EXIT CODES ⭐

the Xpdf tools use these exit codes, and they are iconic in their simplicity:

  1. 0 β€” No error. (we love a clean exit πŸ‘‘)
  2. 1 β€” Error opening a PDF file.
  3. 2 β€” Error opening an output file.
  4. 3 β€” Error related to PDF permissions.
  5. 98 β€” Out of memory.
  6. 99 β€” Other error.

πŸ‘‘ AUTHOR πŸ‘‘

the pdftopng software and documentation are copyright 1996-2025 Glyph & Cog, LLC. periodt.


🌈 SEE ALSO 🌈

xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdffonts(1), pdfdetach(1), pdftoppm(1), pdfimages(1), xpdfrc(5)

http://www.xpdfreader.com/


ok that's the whole page bestie, go forth and convert πŸ’–

and that's a wrap on this little saga β€” brought to you from the 14 Nov 2025 edition of the pdftopng(1) manual page. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from