Image to PDF图片转 PDF
Sending an IC, a passport page or a bank statement to a converter website means handing your document to a stranger. This one builds the PDF on your own machine — the file is written in your browser and never travels anywhere.把身份证、护照页或银行月结单丢给转档网站,等于把文件交到陌生人手上。这个工具在你自己的机器上产生 PDF —— 档案在你的浏览器内写成,不会传去任何地方。
Your images你的图片
One image becomes one page. Use the arrows to set the page order.一张图就是一页。用箭头调整页面顺序。
Page setup页面设定
A4 is the standard everywhere except North America.除了北美,其他地方的标准都是 A4。
How this is calculated计算方式说明
Converting images to PDF is the one job where "just use a free website" is genuinely risky. The files people convert are almost always identity documents, payslips, bank statements, medical letters and tenancy agreements — precisely the documents you would not hand to a stranger. Yet the standard converter works by uploading your file to a server you know nothing about, in a country you did not choose, under a retention policy you did not read.
This tool has no server. The PDF is constructed in your browser and handed straight to your downloads folder.
How a PDF is actually put together
A PDF is not a compressed archive or a picture format. It is a small database of numbered objects written in plain text, plus a lookup table that says where each object begins. This tool writes all of it by hand:
- A header line declaring the version, followed by four deliberately high bytes that mark the file as binary.
- A catalog object — the root of the document — pointing at the page tree.
- A page tree listing every page in order.
- For each page: a page object carrying the
/MediaBox(the physical page size), an image XObject holding the picture, and a content stream — a handful of drawing operators that place the image on the page. - A cross reference table recording the exact byte offset of every object, and a trailer pointing back at it.
The cross reference table is the part that makes hand-written PDFs fail. Every entry must be exactly twenty bytes long and must give the true byte position of its object. If a single offset is wrong the file will not open at all. That is why the bytes are assembled once and measured as they go, rather than being estimated.
Why every image is converted to JPEG first
PDF can store an image using a filter called /DCTDecode, and DCT is exactly what JPEG uses. That means a JPEG's compressed data can be copied into the PDF byte for byte with no decoding and no re-compression — the PDF reader on the other end already knows how to unpack it. A PNG, by contrast, would need to be stored as raw pixels compressed with Flate, which would mean shipping a compression library. So every image you drop in — PNG, WebP, GIF, BMP or JPEG — is drawn onto a canvas and re-encoded as JPEG before being embedded. Transparent areas are flattened onto white, because JPEG has no alpha channel and paper has no transparency either.
Points, page sizes and the DPI confusion
PDF measures everything in points, where one point is exactly 1/72 of an inch. A4 is 210 × 297 mm, which works out to 595.28 × 841.89 pt. US Letter is 612 × 792 pt.
Here is the part that trips everybody up: the page size and the image resolution are independent. Putting a 3,000-pixel-wide photo on an A4 page does not make the page bigger — it makes the image print at about 380 dots per inch. The page size controls physical dimensions; the pixel count controls sharpness. This is why the quality setting in this tool limits the longest edge of each image: past roughly 2,000 pixels on an A4 page you are storing detail no printer will reproduce and no screen will show, and paying for it in file size.
For reference, on a full A4 page: about 1,750 px on the long edge gives 150 DPI (fine for screen reading and adequate for printing), 2,340 px gives 200 DPI, and 3,500 px gives a full 300 DPI print resolution.
Contain or cover?
Contain scales the image until it fits entirely inside the margins. Nothing is lost, but if the image and the page have different shapes you get white bands on two sides. This is what you want for documents, receipts and anything where cropping could remove information.
Cover scales the image until it fills the whole area and crops whatever hangs over the edge. This gives an edge-to-edge result with no white space, and suits photo books and presentation pages — but never use it for a document you are submitting, because it will quietly cut off the sides.
Fit image as a page size sidesteps the choice entirely: each page is made the same shape as its image, so nothing is cropped and nothing is left blank. The trade-off is that the pages may all be different sizes, which some printers and portals dislike.
Margins matter more than you would think
A 10 mm margin is a good default. Set it to 0 only if you know the file will stay digital: virtually every desk printer has an unprintable border of 3–6 mm around the sheet, so a zero-margin PDF will either lose its edges or be silently shrunk to fit. If the PDF is going to be hole-punched or bound, give the margin 20 mm.
Practical notes for submitting documents
- Check the size limit before you submit. Malaysian bank, insurance and government portals commonly cap uploads at 1 MB, 2 MB or 5 MB. If your PDF is over, switch the quality setting to Smallest and rebuild — that alone usually halves the file.
- Shoot documents in even light. Lay the page flat, avoid your own shadow, and fill the frame. A well-lit phone photo at 2,000 px beats a badly-lit one at 4,000 px every time, and compresses far better because JPEG spends most of its bytes on noise.
- Put the pages in order before you build. Reordering afterwards means editing the PDF, which is a much bigger job than clicking the arrows here.
- This produces an image-only PDF. The text inside it is a picture of text, so it cannot be searched or selected. If a form specifically demands searchable or machine-readable text, you need OCR software, not an image converter.
把图片转成 PDF,是「随便找个免费网站用就好」真正有风险的那一类工作。大家会拿去转的档案,几乎都是身份证、薪水单、银行月结单、医疗信件与租约 —— 正好就是你绝不会交给陌生人的那些文件。可是一般的转档网站,运作方式就是把你的档案上传到一台你一无所知的服务器,位在一个你没得选的国家,适用一份你没读过的资料保存政策。
这个工具没有服务器。PDF 在你的浏览器内组出来,直接交给你的下载文件夹。
一份 PDF 到底是怎么组成的
PDF 不是压缩包,也不是图片格式。它其实是一个用纯文字写成、由编号物件构成的小型数据库,外加一张记录「每个物件从第几个字节开始」的对照表。这个工具把这些全部亲手写出来:
- 一行档头声明版本,后面接四个刻意设高的字节,用来标示这是二进制档案。
- 一个 catalog 物件 —— 整份文件的根 —— 指向页面树。
- 一棵页面树,依序列出每一页。
- 每一页各自有:带着
/MediaBox(实体纸张尺寸)的页面物件、装着图片的 image XObject,以及一段内容流 —— 几个把图片摆到页面上的绘图指令。 - 一张记录每个物件确切字节位置的交叉索引表(xref),以及指回它的trailer。
交叉索引表正是手写 PDF 最容易出错的地方。每一笔纪录必须刚好二十个字节,而且必须给出该物件真正的字节位置。只要有一个偏移量算错,整份档案就完全打不开。所以这里的做法是:字节只组一次,并且一边组一边实测长度,而不是用估的。
为什么每张图都先转成 JPEG
PDF 可以用一种叫 /DCTDecode 的过滤器储存图片,而 DCT 正是 JPEG 用的那一套。这代表 JPEG 的压缩资料可以原封不动、一个字节一个字节地抄进 PDF 里,不需要解码、也不需要重新压缩 —— 因为对面的 PDF 阅读器本来就会解 JPEG。相对地,PNG 就得以原始像素搭配 Flate 压缩储存,那就必须额外带一整套压缩函式库。所以你丢进来的每一张图 —— PNG、WebP、GIF、BMP 或 JPEG —— 都会先画到 canvas 上重新编码成 JPEG,然后才嵌入。透明区域会被压平成白色,因为 JPEG 没有 alpha 通道,纸张也不会透明。
点(point)、纸张尺寸,与 DPI 的误解
PDF 的所有尺寸都以点为单位,一点刚好等于 1/72 英寸。A4 是 210 × 297 mm,换算成 595.28 × 841.89 pt;美规 Letter 则是 612 × 792 pt。
最多人搞混的是这一点:纸张尺寸与图片解析度是两回事。把一张 3,000 像素宽的照片放进 A4 页面,不会让页面变大,只会让它以约 380 DPI 印出来。纸张尺寸决定实体大小,像素数量决定清晰度。这也是为什么本工具的质量设定会限制每张图的最长边:在 A4 页面上超过大约 2,000 像素之后,你储存的细节印表机印不出来、屏幕也显示不出来,却要用档案大小去换。
给个参考:整页 A4 的情况下,长边约 1,750 px 相当于 150 DPI(屏幕阅读很够,印刷也可接受),2,340 px 约 200 DPI,3,500 px 则达到完整的 300 DPI 印刷解析度。
「完整显示」还是「填满裁切」?
完整显示(Contain)会把图片缩到完全放进页边距内。什么都不会丢失,但如果图片与纸张比例不同,两侧就会出现白边。文件、收据,以及任何一裁切就可能少掉资讯的东西,都该用这个。
填满裁切(Cover)则会把图片放大到铺满整个区域,超出边界的部分直接裁掉。这样出来的效果是满版无白边,适合相片书与简报页 —— 但要交出去的文件绝对不要用,因为它会不声不响地把两侧切掉。
把纸张大小选成依图片可以完全绕过这个选择:每一页都做成与该图相同的比例,所以既不裁切也不留白。代价是每一页尺寸可能都不同,有些印表机与上传系统不喜欢这样。
页边距比你想的重要
10 mm 是个好用的预设值。只有在你确定这份档案会一直是数码形式时才设 0:几乎每一台桌上型印表机在纸张四周都有 3–6 mm 印不到的范围,所以零边距的 PDF 不是被切掉边缘,就是被默默缩小以求印得下。如果这份 PDF 之后要打孔或装订,页边距请给到 20 mm。
提交文件时的实用提醒
- 提交前先确认大小上限。马来西亚的银行、保险与政府网站常见的上传上限是 1 MB、2 MB 或 5 MB。如果你的 PDF 超标,把质量设定切到「最小」再产生一次,光是这样通常就能把档案砍半。
- 拍文件要用均匀的光线。把纸摊平、避开自己的影子、让文件填满画面。光线好的 2,000 px 手机照片,永远赢过光线差的 4,000 px 照片,而且压缩效率高得多 —— 因为 JPEG 大部分的容量都花在杂讯上。
- 产生之前先把顺序排好。事后要调整顺序就得去编辑 PDF,那比在这里点几下箭头麻烦太多了。
- 这产生的是纯图片 PDF。里面的文字是「文字的图片」,无法搜寻也无法选取。如果某份表格明确要求可搜寻或可机器读取的文字,你需要的是 OCR 软件,而不是图片转档工具。
Frequently asked questions常见问题
Is my document uploaded to a server?我的文件会被上传到服务器吗?
Why is my PDF bigger than the images I put in?为什么产生的 PDF 比我放进去的图片还大?
Can I search or select the text in the PDF afterwards?产生的 PDF 之后可以搜寻或选取文字吗?
Should I use A4 or Letter?我该选 A4 还是 Letter?
How many images can I combine at once?一次可以合并多少张图片?
Need a website that brings you customers?想要一个能带来客户的网站?
We build the demo first. You only pay when you are happy with it.我们先做好 demo 给你看,满意了才付款。
Get a free demo免费获取 Demo