pdftocairo(1)
π pdftocairo(1) π
Manual: pdftocairo(1), General Commands Manual πΈ
β¨ NAME β¨
pdftocairo - Portable Document Format (PDF) to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo π¦
π SYNOPSIS π
pdftocairo [options] PDF-file [output-file]
π DESCRIPTION π
okay so pdftocairo is the tool that takes a Portable Document Format (PDF) file and turns it into basically whatever format you're craving π
It uses the cairo output device of the poppler PDF library to get the job done, and it can make any of these:
- Portable Network Graphics (PNG) π
- JPEG Interchange Format (JPEG) πΈ
- Tagged Image File Format (TIFF) πΌοΈ
- Portable Document Format (PDF) π
- PostScript (PS) π
- Encapsulated PostScript (EPS) π§
- Scalable Vector Graphics (SVG) β¨
- Windows Printer π¨οΈ
so pdftocairo reads the PDF file, PDF-file, and writes to output-file. ngl the naming is kind of a vibe: the image formats (PNG, JPEG, and TIFF) make one file per page, and the page number and file type get tacked onto output-file π’ when you use -singlefile with the image formats, only the file type gets appended to output-file instead. but when the output is a vector format (PDF, PS, EPS, and SVG), output-file is the full filename, no extras π
if the PDF-file is -, the PDF gets read from stdin π«Ά and if the output-file is -, the output gets written to stdout instead. using stdout is not valid with image formats unless you also use -singlefile π and if you skip output-file entirely, the output filename gets derived from the PDF-file filename, so no stress there π
not every option works with every output format, bestie, so be careful π§ you need one (and only one) of the output format options (-png, -jpeg, -tiff, -pdf, -print, -ps, -eps, or -svg). pick one, no double dipping π
the resolution options (-r, -rx, -ry) set the resolution of the image output formats π the image dimensions depend on the PDF page size and the resolution, so they go together like peanut butter and jelly π₯ͺ for the vector outputs, any regions of the page that can't be represented natively in the output format (eg translucency in PS) get rasterized at the resolution you set with the resolution options πΈ
the -scale-to options let you set a fixed image size β¨ the image resolution will change depending on the page size, so it's a trade-off π¦
the cropping options (-x, -y, -W, and -H) use pixels for the image formats and PostScript points (1/72 inch) for the vector formats π when you crop vector output, the cropped region gets centered by default, unless you use -nocenter. in that case it sits at the top left (SVG) or bottom left (PDF, PS, EPS) instead π§
π· OPTIONS π·
-pngβ makes PNG file(s) π-jpegβ makes JPEG file(s). also check out-jpegoptπΈ-tiffβ makes TIFF file(s) πΌοΈ-pdfβ makes a PDF file π-psβ makes a PS file π-epsβ makes an EPS file π§ heads up, an EPS file only holds a single image, so if you use this with a multi-page PDF, you have to use-fand-lto pick a single page. also, the page size options (-origpagesizes,-paper,-paperw,-paperh) can not be used with this one π ββοΈ-svgβ makes an SVG (Scalable Vector Graphics) file β¨-printβ (Windows only) sends it to a system printer π¨οΈ also see-printerand-printeropt.- if you don't specify an output file, the output goes straight to the printer π«Ά
- > the output file
-can not be used with this option. don't even try it, bestie π
-printdlgβ (Windows only) also prints to a system printer, but first it pops up the print dialog so you can tweak the print options before sending anything π-f numberβ picks the first page to convert π₯-l numberβ picks the last page to convert π-oβ only makes the odd numbered pages 1οΈβ£-eβ only makes the even numbered pages 2οΈβ£-singlefileβ writes only the first page and skips adding digits to the filename π«§-r numberβ sets the X and Y resolution, in pixels per inch for image files (or for the rasterized regions in vector output) π the default is 150 PPI π-rx numberβ sets just the X resolution, in pixels per inch for image files (or rasterized regions in vector output) π the default is 150 PPI β¨-ry numberβ sets just the Y resolution, in pixels per inch for image files (or rasterized regions in vector output) π the default is 150 PPI πΈ-scale-to numberβ scales the long side of each page (width for landscape pages, height for portrait pages) so it fits innumberpixels π¦ the short side gets sized by the page's aspect ratio (PNG/JPEG/TIFF only) πΌοΈ-scale-to-x numberβ scales each page horizontally so it fits innumberpixels wide π ifscale-to-yis set to-1, the vertical size gets figured out from the page's aspect ratio (PNG/JPEG/TIFF only) π-scale-to-y numberβ scales each page vertically so it fits innumberpixels tall π ifscale-to-xis set to-1, the horizontal size gets figured out from the page's aspect ratio (PNG/JPEG/TIFF only) π-x numberβ the x-coordinate of the top left corner of the crop area, in pixels (image output) or points (vector output) βοΈ-y numberβ the y-coordinate of the top left corner of the crop area, in pixels (image output) or points (vector output) βοΈ-W numberβ the width of the crop area, in pixels (image output) or points (vector output). default is0π-H numberβ the height of the crop area, in pixels (image output) or points (vector output). default is0π-sz numberβ the size of a square crop, in pixels (image output) or points (vector output). this one sets both-Wand-Hfor you π«Ά-cropboxβ uses the crop box instead of the media box when generating the files (PNG/JPEG/TIFF only) πΌοΈ-monoβ makes a monochrome file (PNG and TIFF only) β«-grayβ makes a grayscale file (PNG, JPEG, and TIFF only) π©Ά-antialiasβ sets the cairo antialias option used for text and drawing in image files (or rasterized regions in vector output) π«§ the options are:defaultβ uses the default antialiasing for the target device. this is what you get if you skip-antialiasaltogether πnoneβ antialiasing is turned off π ββοΈgrayβ does single-color antialiasing using shades of gray π©Άsubpixelβ does antialiasing by taking advantage of the order of subpixel elements on devices like LCDs π±fastβ hints that the backend should do some antialiasing but prefers speed over quality ποΈgoodβ the backend should balance quality against performance βοΈbestβ hints that the backend should render at the highest quality, even if it costs speed π
-transpβ uses a transparent page color instead of white (PNG and TIFF only) π«§-icc icc-fileβ uses the specified ICC file as the output profile (PNG only) π the profile gets embedded right into the PNG file π-jpegopt jpeg-optionsβ when used with-jpeg, takes a list of options that control the JPEG compression ποΈ see JPEG OPTIONS for the available options πΈ
β¨ JPEG OPTIONS β¨
okay so when you're outputting JPEG, you can use -jpegopt to tweak the compression settings π«Ά it takes a string that looks like "<opt>=<val>[,<opt>=<val>]", and right now there are three options you can play with π
qualityβ this one picks your JPEG quality. The value has to be a whole number from0to100πΈprogressiveβ turns progressive JPEG output on or off. You give ityfor yes ornfor no πoptimizeβ tells it whether to work out the best Huffman coding tables for your JPEG. Your file ends up smaller, but it has to make an extra pass over the data, so it's a little slower π’ Useyto optimize. Anything else (so,n) and it just sticks with the default Huffman tables π§
β¨ WINDOWS PRINTER OPTIONS β¨
on Windows, you can skip the file step entirely and send the output straight to a system printer with -print π¨οΈ and if you want to fine-tune how it prints, -printopt is your bestie. It takes a string that looks like "<opt>=<val>[,<opt>=<val>]", and these are the options you can use:
sourceβ picks which paper tray (bin) you want. You can chooseupper,onlyone,lower,middle,manual,envelope,envmanual,auto,tractor,smallfmt,largefmt,largecapacity, orformsource. Or, if you want something driver-specific, just give it a number πduplexβ sets the duplex mode, aka whether it prints on both sides π You can chooseoff(no duplexing),short(short-edge binding), orlong(long-edge binding) π Also, the general-duplexflag is basically the same thing asduplex=long. But if you use both,-printoptwins, no debate π
β¨ AUTHOR β¨
the pdftocairo software and its docs are copyright 1996-2004 Glyph & Cog, LLC, and copyright 2005-2011 The Poppler Developers π
β¨ SEE ALSO β¨
literally go check these out if you want more π¦ pdfdetach(1), pdffonts(1), pdfimages(1), pdfinfo(1), pdftohtml(1), pdftoppm(1), pdftops(1), pdftotext(1), pdfseparate(1), pdfsig(1), and pdfunite(1) π§
bestie, that's the whole page π you're officially a pdftocairo(1) girlie now πΈ stay iconic, and I'll see you in the next chat π«Άβ¨
π¦ where this page comes from
- alpine 3.22: poppler-doc 25.04.0-r0 Β· GPL-2.0-or-later
- alpine 3.23: poppler-doc 25.12.0-r0 Β· GPL-2.0-or-later
- alpine 3.24: poppler-doc 25.12.0-r1 Β· GPL-2.0-or-later
- arch rolling: poppler 26.10.0-2 Β· GPL-2.0-only AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND HPND-sell-variant
- centos-stream 10: poppler-utils 24.02.0-10.el10 Β· (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
- debian trixie: poppler-utils 25.03.0-5+deb13u3 Β· GPL-2.0-only OR GPL-3.0-only
- debian trixie: poppler-utils 25.03.0-5+deb13u4 Β· GPL-2.0-only OR GPL-3.0-only
- fedora 43: poppler-utils 25.07.0-2.fc43 Β· (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
- fedora 43: poppler-utils 25.07.0-5.fc43 Β· (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
- fedora 44: poppler-utils 26.01.0-3.fc44 Β· (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
- nixos 26.05: poppler-utils 26.10.0
- nixpkgs unstable: poppler-utils 26.10.0
- opensuse-leap 16.0: poppler-tools 25.04.0-160000.4.1 Β· GPL-2.0-only OR GPL-3.0-only
- opensuse-leap 16.0: poppler-tools 25.04.0-160000.4.1 Β· GPL-2.0-only OR GPL-3.0-only
- opensuse-leap 16.0: poppler-tools 25.04.0-160000.4.1 Β· GPL-2.0-only OR GPL-3.0-only
- opensuse-leap 16.0: poppler-tools 25.04.0-160000.4.1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu noble: poppler-utils 24.02.0-1ubuntu9 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu noble: poppler-utils 24.02.0-1ubuntu9.10
- ubuntu noble: poppler-utils 24.02.0-1ubuntu9.11 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: poppler-utils 25.03.0-10
- ubuntu questing: poppler-utils 25.03.0-10ubuntu0.2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu resolute: poppler-utils 26.01.0-2build2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu resolute: poppler-utils 26.01.0-2ubuntu0.2
- ubuntu resolute: poppler-utils 26.01.0-2ubuntu0.3 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: poppler-utils 26.07.0-2ubuntu1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: poppler-utils 26.07.0-2ubuntu1.1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms