From 131afc3ee1aa5b4a9ae48fe06f3c7d05928e3d7b Mon Sep 17 00:00:00 2001 From: MT <59728838+mt-empty@users.noreply.github.com> Date: Tue, 4 Feb 2020 04:54:00 +1100 Subject: [PATCH] pdftocairo: add page (#3824) --- pages/common/pdftocairo.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/pdftocairo.md diff --git a/pages/common/pdftocairo.md b/pages/common/pdftocairo.md new file mode 100644 index 0000000000..04f5bfe04c --- /dev/null +++ b/pages/common/pdftocairo.md @@ -0,0 +1,28 @@ +# pdftocairo + +> Converts PDF files to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo. +> More information: . + +- Convert a PDF file to JPEG: + +`pdftocairo {{path/to/file.pdf}} -jpeg` + +- Convert to PDF expanding the output to fill the paper: + +`pdftocairo {{path/to/file.pdf}} {{output.pdf}} -pdf -expand` + +- Convert to SVG specifying the first/last page to convert: + +`pdftocairo {{path/to/file.pdf}} {{output.svg}} -svg -f {{first_page}} -l {{last_page}}` + +- Convert to PNG with 200ppi resolution: + +`pdftocairo {{path/to/file.pdf}} {{output.png}} -png -r 200` + +- Convert to grayscale TIFF setting paper size to A3: + +`pdftocairo {{path/to/file.pdf}} -tiff -gray -paper A3` + +- Convert to PNG cropping x and y pixels from the top left corner: + +`pdftocairo {{path/to/file.pdf}} -png -x {{x_pixels}} -y {{y_pixels}}`