文件格式任意转换助手Transfer Any File

离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser

JSON 转 PDF——离线、带语法配色、不上传JSON to PDF offline, syntax coloured, no upload

这条路是两步合成的,产物形态由后一步决定。前一步把 JSON 渲染成语法高亮的可折叠查看器:键、字符串、数字、布尔与 null 各有颜色,对象与数组带 `Object(n)` / `Array(n)` 的计数摘要,并且**默认全部展开**——所以折叠状态的节点不会被裁掉。后一步把这份 HTML 净化后离屏渲染成整页画布,再按 A4 切成多页写进 PDF。因此产物是「查看器的分页截图」:看起来像文档,但每个字都是位图,不能选中、不能被搜索。也正因为整页要一次渲染,它有高度上限:超过约 32768 px 会报「页面过高」,而不是给你一份被静默截断的 PDF。This route is two steps, and the second one decides what you get. The first renders the JSON as a collapsible, syntax-coloured viewer: keys, strings, numbers, booleans and null each take a colour, objects and arrays carry an `Object(n)` / `Array(n)` count, and everything is **expanded by default**, so nothing hidden behind a collapsed node is left out. The second renders that document off-screen onto a page canvas, slices it into A4 pages and writes them into a PDF. So the artefact is a paginated picture of the viewer: it looks like a document, yet every glyph is a bitmap — nothing can be selected or searched. Because the whole page must be rendered in one pass, it has a height ceiling: past roughly 32768 px the job reports an over-tall page instead of handing you a silently truncated PDF.

一批转换结果卡片,含文件名、体积与下载入口
一次混合批量,一个 ZIP 下载One mixed batch, one ZIP download

这条链路怎么走How the route runs

JSONJSON HTMLHTML PDFPDF

共 2 步,由扩展的路径搜索自动选出,中间产物不落盘。2 steps, chosen by the extension's own path search; intermediate results never touch the disk.

会保留什么What carries over

  • 层级与配色进画面:缩进、键名颜色、`Object(n)` / `Array(n)` 计数都留在 PDF 里,默认展开所以没有藏在折叠状态下的内容被漏掉Hierarchy and colour reach the page: indentation, key colours and the `Object(n)` / `Array(n)` counts stay in the PDF, and the default-expanded state means nothing hidden behind a collapsed node is left out
  • 按 A4 分页:长文档得到多页 PDF,页与页之间是整页位图切片,而不是把内容压扁挤进一页A4 slicing: a long document yields several pages of whole-page bitmaps rather than being squeezed flat into one
  • 渲染面宽度固定 800 px,与工作台预览同一套版式,所以「看到的」与「转出来的」是同一张页面The render surface is 800 px wide, the same layout the workbench preview uses, so what you saw and what comes out are the same page
  • 不可信内容在渲染前净化:JSON 里的字符串只作为文本呈现,渲染边界还会剥掉远程子资源引用,产物不会在打开时替你去取网络上的东西Untrusted content is sanitised before rendering: strings appear as text only, and the render boundary strips remote subresource references, so the artefact never goes fetching on your behalf when it opens

如实说明的限制What it does not do

  • 没有文字层:PDF 里每个字都是位图,不能选中、复制或被搜索引擎检索。要文字请用 JSON 转 HTML(浏览器里可直接打印)或转 TXTNo text layer: every glyph in the PDF is a bitmap, so nothing can be selected, copied or searched. For text, take JSON to HTML (printable from the browser) or to TXT
  • 高度上限:整页捕获约 32768 px,深结构或超大 JSON 全部展开后很容易超过,这时报「页面过高」并让你分段,而不是静默截断A height ceiling: whole-page capture tops out near 32768 px, and a deep or huge JSON fully expanded easily exceeds it — the job then reports an over-tall page and tells you to split, instead of truncating quietly
  • 分辨率按页高自动降档(2 / 1.5 / 1 倍像素比),特别高的文档字迹会比短文档更软Resolution steps down with page height (2 / 1.5 / 1 pixel ratio), so a very tall document comes out softer than a short one
  • 等宽但非编辑器:长键名与长值会按 800 px 版式折行,列的位置不保证与编辑器里逐字符对齐Monospaced, not an editor: long keys and long values wrap to the 800 px layout, so columns are not guaranteed to line up character-for-character
  • 解析不了的 JSON 直接报错,不会给你一份空白 PDF;单个文件上限 100 MB、一批最多 200 个JSON that cannot be parsed fails outright rather than producing a blank PDF; 100 MB per file and 200 files per batch

实操提示Working with it

  • 要的是能全文检索的档案:走 JSON 转 HTML,浏览器里直接 Ctrl+P 打印,得到带文字层的 PDFFor a searchable archive: take JSON to HTML and print it from the browser, which yields a PDF with a real text layer
  • 要的是当图表存档:走 JSON 转 PNG,一张图看完整个结构For a picture of the structure to file away: take JSON to PNG, one image showing the whole tree
  • 要的是能继续筛排的表格数据:先把 JSON 转 CSV 或 Excel,再决定要不要出 PDFFor data you still want to filter: convert JSON to CSV or Excel first, then decide whether a PDF is the right end product

常见问题Questions people actually ask

PDF 里的文字能搜索或复制吗?Can I search or copy the text in that PDF?

不能。这条链路的终点是「整页渲染成位图再按 A4 分页」,产物不含文字层,也无法嵌入字体子集。这么选的代价是可搜索性,换来的是不需要把查看器的排版权交给字体嵌入逻辑——要文字层就转 HTML 再自行打印。No. The route ends at “render the page to a bitmap, slice it into A4”, so the artefact has no text layer and no embedded font subsets. The cost is searchability; what it avoids is handing the viewer’s typography to a font-embedding step. For a text layer, convert to HTML and print it yourself.

为什么报「页面过高」而不是给我一份截断的 PDF?Why does it report an over-tall page instead of just truncating?

整页捕获的上限约 32768 px,浏览器在远超这个高度时返回的往往是空白画布——那种「成功但全白」比一条明确的错误难查得多。所以这里选择当场失败并提示分段(或改转 HTML / PNG)。Whole-page capture caps out near 32768 px, and browsers well beyond that return a blank canvas — “succeeded, but all white” is far harder to diagnose than a clear error. So this fails loudly and suggests splitting, or going to HTML / PNG instead.

折叠起来的那些节点会不出现在 PDF 里吗?Will nodes I collapsed be missing from the PDF?

不会。查看器渲染时所有对象与数组都是展开状态,PDF 拍到的是完整的树——包括很深的一层。反过来说,这也正是高度容易吃满的原因。No. The viewer renders every object and array expanded, so the PDF captures the whole tree, however deep. That is exactly why the page height runs away, too.

接口返回的原始 JSON 会外发吗?Is the raw JSON from an API ever sent anywhere?

不会。解析、渲染、净化、分页、写 PDF 全在扩展自己的标签页里完成,只申请 storage 权限、没有 host 权限,全程零网络请求。No. Parsing, rendering, sanitising, slicing and writing the PDF all happen inside the extension’s own tab: the storage permission only, no host permissions, and no requests at any point.

不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.