This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
如果我想将一些扫描合并到一个 PDF 文件中,我会这样做:
这将为您提供一个 DIN-A4 页面大小的 PDF 文档,其中每个
png
文件都位于其自己的页面的中心。对于一张 DIN-A4 页面来说太大的图像会按比例调整大小以适合一页。较小的图像不会调整大小(不会变大)。您必须在命令行上命名所有
png
文件,但您也可以使用通配符来合并当前目录中的所有 png 文件:pdfjoin
命令是 PDFjam 的一部分正如耶利米·威尔科克(Jeremiah Willcock)的回答中提到的。因此,您很可能必须使用发行版包管理器安装名为pdfjam
或texlive-extra-utils
的包。自 2010 年 11 月 13 日发布的 2.07 版本起,PDFjam 就可以使用png
文件作为输入。If I want to merge some scans to one PDF file, I do this:
This gives you a PDF document with DIN-A4 page size, where every
png
file is centered on it's own page. Images that are too big for one DIN-A4 page are resized proportionally to fit on one page. Smaller images are not resized (not made bigger).You have to name all
png
files on the command line, but you can also use wildcards to eg merge all png files in the current directory:The
pdfjoin
command is part of PDFjam as mentioned in the answer by Jeremiah Willcock. So you will most likely have to install a package namedpdfjam
ortexlive-extra-utils
with your distros package manager. PDFjam is able to usepng
files as input since Version 2.07, released in 2010-11-13.通过查看 ImageMagick 上的文档,可能很简单:
查看有关可能风险的评论。如果这不起作用,PDFjam< /a> 声称能够解决您的问题。
From looking through the documentation on ImageMagick, it might be as easy as:
See comments about possible risks. If that doesn't work, PDFjam claims to be able to solve your problem.
ImageMagick 的转换 工具是我的偏好。
如果您希望图像文件(以及它们的质量和文件大小)保持不变,只需在它们周围放置一个 PDF 容器:
如果您想要较小的文件大小,并且可以接受质量损失,您可以首先将它们转换为 JPEG 格式。 (ImageMagick 还支持更改 PNG 压缩级别,但通常您的输入文件已经使用最高级别。)
使用 0 到 100 之间的值作为
质量
选项。或者,您可以通过将图像重新采样到特定分辨率来达到较低的文件大小(和质量)。
resample
的值指的是每英寸的像素数。 ImageMagick 从输入图像的 EXIF 部分读取原始密度,回落到 72 dpi。您可以使用密度
参数为输入图像设置自定义分辨率。当然,您也可以组合
compress
、quality
和resample
参数。ImageMagick’s convert tool is my preference.
If you want the image files (and thus, their quality and file size) unaltered, and just put a PDF container around them:
In case you want to have a smaller file size, and you are okay with a loss in quality, you can convert them to the JPEG format first. (ImageMagick also supports changing the PNG compression level, but usually your input files are already using the highest level.)
Use a value between 0 and 100 for the
quality
option.Alternatively, you can reach a lower file size (and quality) by resampling the images to a certain resolution.
The value for
resample
refers to the number of pixels per inches. ImageMagick reads the original density from EXIF part of the input images, falling back to 72 dpi. You can use thedensity
parameter to set a custom resolution for the input images.You can of course also combine the
compress
,quality
, andresample
parameters.我偷了这个,但这是我从 Jeremiah Willcock 和另一个答案网站使用的解决方案。暂时不去挖掘历史。我撒谎了,我确实这么做了。 (塔莉@https://askubuntu.com/a/626301)
我需要一个足够小的文件来通过电子邮件发送。
将图像合并为 PDF
(在工作目录中使用命令行:
合并后使用 Ghostscript 缩小
(我几乎在kde默认系统上使用):
我的文件有14张图像(转换后19MB,gs使其为1.6MB,质量仍然很棒)。输出文件名为
output.pdf
。I stole this, but this is the solution I used from Jeremiah Willcock and another answer website. Not digging through history at the moment. I lied, I did. (Tully @https://askubuntu.com/a/626301)
I needed a file small enough to email.
To combine images into a PDF
(from in working directory use command line:
To shrink using ghostscript after combining
(I used on kde default system almost):
My file had 14 images (19MB after convert, gs made it 1.6MB, quality was still great). The output file is called
output.pdf
.