离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser
SVG 转 Word——离线、矢量在第二步变位图、结果会写明SVG to Word offline — the vector turns bitmap in step two
这条最容易被讲反的地方是「**在哪一步变成位图**」。`svg>html` 那一步**不栅格化**——它把图形作为矢量留在页面里(净化用的是保留 svg 与 svgFilters 的配置,脚本与事件属性去掉,渐变滤镜这些可见结果留下)。真正变位图的是第二步 `html>docx`:它在净化**之前**把文档里每一个内联 SVG 逐个取出来,走「剥活动性内容 → 规范化尺寸 → 画进画布 → 输出 PNG 数据 URL」,再把 `<img>` 换上去。顺序是有原因的:净化用的 html profile 里**根本没有 svg 标签**,如果先净化,用户的图会被当成可执行标记一起删掉,产物是一份合法但空白的 .docx,而界面还报成功。栅格化时按最长边钳制到本扩展的图片上限、**只缩不放**,所以巨大的 SVG 不会撑爆画布,小的也不会被硬拉大。之后 `html>docx` 才净化、剥掉远程引用并交给打包器——那份 PNG 数据 URL 会被提成包里独立的图片部件,`Word` 显示它不需要取数。两件对用户可见的事:结果卡会写明**这一次发生过栅格化**(界面上单独一行提示,不是只写在文档里),以及产物是 altChunk 包装——排版与分页由打开它的程序决定。代价要说清:**缩放不再无损**,进 Word 之后它是一张位图,放大就是像素;想要保留矢量就不要进 Word(SVG→HTML 保留矢量,SVG→PDF 那一条第一步就 `svg>png` 栅格化,反而不是留矢量的路)。依赖 `<use>` 的雪碧图这一类要特别注意:`<symbol>` 的定义会被 svg profile 留下、引用层去掉,栅格化出来的往往是空图——那种文件更适合先 SVG→PNG 再交给 Word。全程只有 storage 权限,不联网。The thing most often stated backwards about this route is **which step turns it into a bitmap**. `svg>html` does not rasterise — the artwork stays vector in the page, sanitised with a profile that keeps `svg` and `svgFilters`, so scripts and event handlers go while gradients and filters survive. The bitmap happens in step two, `html>docx`: **before** sanitising, it takes each inline SVG out of the document and runs it through «strip active content → normalise the size → draw on a canvas → emit a PNG data URL», swapping in an `<img>` afterwards. The order is load-bearing: the html profile this step sanitises with has **no svg tags at all**, so sanitising first would delete the user’s diagram as if it were executable markup and hand back a valid, blank .docx that the interface reported as a success. Rasterisation clamps the longest edge to this extension’s image ceiling and **only ever scales down**, so an enormous SVG cannot blow up the canvas and a small one is not stretched. Only then does `html>docx` sanitise, strip remote references and hand the markup to the packer — that PNG data URL becomes its own image part inside the package, so nothing has to be fetched to display it. Two things are visible to the user: the result card **says when rasterisation happened** (a line of its own in the interface, not just fine print on this page), and the artifact is an altChunk wrapper, so layout and paging belong to whichever program opens it. Say the cost plainly: **zooming is no longer lossless** — inside Word it is a bitmap, and enlarging shows pixels. If keeping the vector matters, do not go into Word (SVG to HTML keeps it vector; SVG to PDF rasterises in its very first step, so it is not the vector-preserving road either). One input shape deserves its own warning: a sprite built on `<use>` keeps its `<symbol>` definitions but loses the referencing layer, so what rasterises is often an empty picture — those files are better taken SVG to PNG first, then into Word. All of it on the storage permission, with no network at all.
这条链路怎么走How the route runs
SVGSVG HTMLHTML Word (.docx)Word (.docx)
共 2 步,由扩展的路径搜索自动选出,中间产物不落盘。2 steps, chosen by the extension's own path search; intermediate results never touch the disk.
会保留什么What carries over
- 可见结果留下:渐变、滤镜与图形本身的绘制都进图,脚本与事件属性被去掉The visible result survives: gradients, filters and the drawing itself reach the image, while scripts and event handlers are removed
- 栅格化在净化之前做:所以用户的图形不会被 html profile 当成 svg 标记一并删掉Rasterisation runs before sanitising, so the user’s artwork is not deleted by an html profile that contains no svg tags
- 只缩不放:按最长边钳到本扩展的图片上限,小图不被拉伸、大图不撑爆画布Down-only: the longest edge is clamped to this extension’s image ceiling, so small pictures are not stretched and huge ones cannot blow up the canvas
- PNG 数据 URL 会被提成包里独立的图片部件,显示它不需要任何一次取数The PNG data URL is lifted into its own image part in the package, so displaying it takes no request
- 结果卡单独一行写明这次发生了栅格化,不是只在文档里提一句The result card says in its own line that rasterisation happened, rather than leaving it to this page’s fine print
如实说明的限制What it does not do
- 进 Word 之后就是位图:放大看到的是像素,缩放不再无损Inside Word it is a bitmap: enlarging shows pixels and zoom is no longer lossless
- 依赖 `<use>` 的雪碧图常栅格化成空图——`<symbol>` 留下、引用层被去掉,这类文件请先 SVG→PNGSprites built on `<use>` often rasterise to an empty picture — the `<symbol>` definitions stay while the referencing layer goes, so take those files SVG to PNG first
- 文档体是 altChunk:排版与分页由打开它的程序决定,本扩展不产出 Word 原生段落The body is an altChunk: layout and paging are the reader’s, and no native Word paragraphs are produced
- 分辨率由画布按钳制后的尺寸决定,不是矢量导出;要更清晰的成品请用更大的源Resolution comes from the canvas at the clamped size, not from a vector export — use a larger source if you need a crisper result
- 一批最多 200 个文件、单个 100 MB,与其他路线共用同一道闸门Up to 200 files per batch and 100 MB each — the same gate every other route shares
实操提示Working with it
- 要留矢量:SVG→HTML,图形作为矢量进页面,放大看到的还是路径To keep it vector: SVG to HTML, where zooming still shows paths
- 要每页一张图的文档:SVG→PDF(第一步 `svg>png` 栅格化,页面按图片尺寸)For a document with one image per page: SVG to PDF, which rasterises in its first step and sizes the page to the picture
- 要固定像素尺寸:SVG→PNG / JPG / WebP,那边才有最长边与质量开关For a fixed pixel size: SVG to PNG, JPG or WebP, where the longest-edge and quality controls live
常见问题Questions people actually ask
SVG 进 Word 还是矢量吗?Is my SVG still vector once it is in Word?
不是,而且这一步发生在 `html>docx`:每个内联 SVG 在净化前被画到画布上、输出 PNG 数据 URL,再被打包器提成包内图片部件。所以进 Word 之后它和一张普通截图没有区别——放大是像素,缩放不再无损。要保留矢量,走 SVG→HTML。No, and the step that decides it is `html>docx`: every inline SVG is drawn onto a canvas and emitted as a PNG data URL before sanitising, then lifted by the packer into an image part. So inside Word it behaves like any screenshot — pixels on zoom, no longer lossless. For the vector, take SVG to HTML.
为什么转换前要先栅格化、而不是先净化?Why rasterise before sanitising rather than the other way round?
因为净化用的 html profile 里没有 svg 标签。先净化的话,用户的图形会被连同可执行标记一起删掉,而打包那一步照样产出一份能打开的 .docx——界面报成功,内容却是空的。这个顺序就是为了让「砍活动性内容」和「留住图形」同时成立。Because the html profile used for sanitising contains no svg tags at all. Sanitising first would delete the user’s artwork along with executable markup, and the packer would still produce an openable .docx — the interface reporting success over an empty page. This order is what lets the step cut active content and keep the drawing at the same time.
界面会告诉我这次把 SVG 栅格化了吗?Does the interface tell me the SVG was rasterised?
会。转换器在这一步返回一个「已栅格化」标记,结果卡据此单独显示一行提示,只在真发生了栅格化时出现——多步链里任何一步把它置上都会带到批次结果里。这也是为什么这一路的披露不靠用户自己想到去看分辨率。Yes. The converter returns a rasterised flag for that step and the result card shows its own line for it, appearing only when rasterisation actually happened — and in a multi-step chain any step can set it and it carries through to the batch result. That is why the disclosure here does not depend on the user thinking to inspect the resolution.
不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.
从 Chrome 应用商店安装Install from the Chrome Web Store 安装步骤Install steps GitHub 源码Source on GitHub