如何将A4 JPEG扫描页面转换为A4 pdf [英] Howto convert A4 jpeg scanned page to A4 pdf

查看:242
本文介绍了如何将A4 JPEG扫描页面转换为A4 pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jpeg扫描页(toto.jpg),我想使用imagemagick convert命令转换为A4 pdf文件.

I have a jpeg scanned page (toto.jpg) that I want to convert to a A4 pdf file with imagemagick convert command.

我一直在尝试-page A4-resize 595x842-define pdf:fit-page=A4选项,但是它不起作用,我没有获得正确的大小:

I've been trying the -page A4, -resize 595x842 and -define pdf:fit-page=A4 options but it does not work, I don't obtain the correct size :

$ identify toto.jpg 
toto.jpg JPEG 1644x2304 1644x2304+0+0 8-bit DirectClass 902KB 0.000u 0:00.000
$ convert -density 300 -page a4 toto.jpg toto.pdf 
$ identify toto.pdf 
toto.pdf PDF 143x202 143x202+0+0 16-bit Bilevel DirectClass 3.7KB 0.000u 0:00.000
$ convert -density 300 -resize 595x842 toto.jpg toto.pdf 
$ identify toto.pdf 
toto.pdf PDF 143x200 143x200+0+0 16-bit Bilevel DirectClass 3.66KB 0.000u 0:00.000
$ convert -density 300 -define pdf:fit-page=A4 toto.jpg toto.pdf 
$ identify toto.pdf 
toto.pdf PDF 395x553 395x553+0+0 16-bit Bilevel DirectClass 27.7KB 0.000u 0:00.000

你能帮我吗?

推荐答案

经过几个小时的尝试,我发现我使用的输出分辨率不正确.

After a few hours of trying, I've found the output resolution I was using was wrong.

要从图片生成pdf,必须更改输出密度以适合屏幕尺寸,即72dpi:

To produce a pdf from a picture, one must change the output density to fit the screen's, that is to say 72dpi :

$ convert -density 72 -page A4 toto.jpg toto.pdf

这也有效:

$ convert +density -page A4 toto.jpg toto.pdf

生成的pdf是:

$ identify toto.pdf 
toto.pdf PDF 595x842 595x842+0+0 16-bit Bilevel DirectClass 63.2KB 0.000u 0:00.000

这篇关于如何将A4 JPEG扫描页面转换为A4 pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆