我不知道如何使用工具pdftocairo
将带有单张图片的"横向"PDF 文件(例如,paperwidth=842 和纸张高度 = 595 磅,图像填充整个页面)转换为 EPS 文件。
我得到的输出要么是原始文件的缩小版本(宽度从 842 缩放到 595 以适应 EPS 文件的"不正确"页面宽度 595),要么是 EPS,其中 595 和 842 之间的内容被切断(使用 -noshrink
参数)。
有什么想法吗?
编辑1:pdftocairo version 0.43.0
输入 PDF: pdfinfo test.pdf
Creator: DocType PDF-Emitter (DocType PDF-Emitter v1.9.37-9-g1b2b6f3)
Producer: Haru Free PDF Library 2.3.0RC2
CreationDate: Mon Jun 4 11:18:30 2018
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 1
Encrypted: no
Page size: 595.44 x 841.68 pts
Page rot: 90
File size: 149246 bytes
Optimized: no
PDF version: 1.3
景观 PDF
用pdftocairo -eps测试转换.pdf
景观EPS
Poppler(在我的系统上,它是v0.42.0)具有以下命令行选项,可能会有所帮助:
$ pdftocairo -h
pdftocairo version 0.42.0
Copyright 2005-2016 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC
Usage: pdftocairo [options] <PDF-file> [<output-file>]
[....]
-eps : generate Encapsulated PostScript (EPS)
[....]
-r <fp> : resolution, in PPI (default is 150)
-rx <fp> : X resolution, in PPI (default is 150)
-ry <fp> : Y resolution, in PPI (default is 150)
-scale-to <int> : scales each page to fit within scale-to*scale-to pixel box
-scale-to-x <int> : scales each page horizontally to fit in scale-to-x pixels
-scale-to-y <int> : scales each page vertically to fit in scale-to-y pixels
-x <int> : x-coordinate of the crop area top left corner
-y <int> : y-coordinate of the crop area top left corner
-W <int> : width of crop area in pixels (default is 0)
-H <int> : height of crop area in pixels (default is 0)
-sz <int> : size of crop square in pixels (sets W and H)
-cropbox : use the crop box rather than media box
[....]
-level2 : generate Level 2 PostScript (PS, EPS)
-level3 : generate Level 3 PostScript (PS, EPS)
-origpagesizes : conserve original page sizes (PS, PDF, SVG)
-paper <string> : paper size (letter, legal, A4, A3, match)
-paperw <int> : paper width, in points
-paperh <int> : paper height, in points
-nocrop : don't crop pages to CropBox
-expand : expand pages smaller than the paper size
-noshrink : don't shrink pages larger than the paper size
-nocenter : don't center pages smaller than the paper size
[....]