本文へスキップ

SVGをPDFに変換

ベクター画像を、ピクセルに変えずにPDFにします。

お使いの端末で処理

このツールはブラウザーの中だけで動きます。ファイルがアップロードされることはなく、そのことはブラウザーのネットワークタブでご自身で確認できます。 ご自分で確かめてください。ブラウザーのネットワークタブを開いて見てください。残りの作業回数を尋ねる小さなリクエストが1つだけ表示されます。ツール名とハッシュだけで、ファイルは決して含まれません。

このツールでできること

This translates the SVG's geometry into PDF drawing operations rather than rasterising it. Paths, rectangles, circles, ellipses, polygons, lines, strokes, fills and text all become PDF vectors, so the result stays sharp at whatever size a printer sets it. The parts of SVG that have no PDF equivalent are named in the result banner rather than drawn flat, so you learn what was left out instead of wondering why the artwork looks thin.

Use it when a printer, a form or a colleague asks for a PDF of something you only have as an SVG: a logo for a sign or a banner, a diagram exported from a drawing tool, an icon sheet, or a chart out of a plotting library that writes SVG and nothing else.

仕組み

  1. Drop your .svg files onto this page. Up to 100 at a time, each up to 25 MB.
  2. Choose the page size. Match makes the page exactly the size of the drawing plus the margin, which is what a print shop usually wants; A4, Letter and A3 centre the artwork on that sheet instead.
  3. Set the margin if you want whitespace around the drawing. It is 0 by default, because artwork sized to its own bounds is easier to place afterwards.
  4. Choose the background. Transparent leaves the page unpainted, which is right for something going on top of another design; white paints a white rectangle, which is right for anything printed on its own.
  5. Press Convert. Each SVG becomes a one-page PDF, and the banner names anything in the file that could not be drawn.

The easy way to build this tool is to rasterise: draw the SVG to a canvas and embed the pixels. It is also the wrong way, because the reason anybody converts SVG to PDF is to keep it sharp at print size, and a 150 dpi picture of a logo defeats the whole exercise. Here the geometry is translated instead, so the drawing scales like the original and a sign printed at two metres is as clean as an icon printed at two centimetres.

What that costs is honesty about the parts of SVG with no PDF counterpart. Filters, masks, clip paths more complicated than a rectangle, gradients, patterns, markers, use references, foreignObject, animation and anything scripted are collected as they are met and reported by name. Naming them is the point: gradient, filter tells you what to change in your drawing program, whereas two unsupported features tells you nothing. Flatten those parts to plain shapes in your editor and convert again.

Text is drawn as real PDF text, so it stays selectable and searchable, but the typeface named in the file is not the one you get. A font-family list is mapped onto the three families available here - anything mentioning mono, courier, consolas or menlo becomes monospace, anything mentioning serif, times, georgia or garamond becomes serif, and everything else becomes sans. Character widths therefore differ from the browser's rendering, so a tightly positioned label can shift. If exact position matters, convert the text to outlines in your drawing program first and it will come across as geometry.

Page size and scale interact in a way worth knowing before you tune either. With Match, the page is the drawing at your chosen scale plus twice the margin, and nothing is resized after that. With a fixed sheet, the drawing is scaled by your percentage and then reduced further if it still does not fit inside the margins - never enlarged past the sheet - and centred on the page. So on A4 a scale above 100 per cent has no effect once the drawing already fills the sheet.

Only images written into the file as data URIs are embedded. A linked image points at a file or a web address, and going out to fetch it would be an outbound request from a tool that promises none, so it is reported as a linked image instead of being retrieved. Each SVG becomes its own single-page PDF; if you want a set of drawings in one document, run Merge PDF on the results.

このツールにできないこと

  • Filters, masks, gradients, patterns, markers, use references, foreignObject and animation cannot be drawn. They are named in the result rather than approximated.
  • The typeface named in the file is not embedded. Text is set in one of three families and character widths differ, so tightly positioned labels can shift.
  • Linked images and other external references are not fetched, because that would be an outbound request. Only data URIs are embedded.

よくある質問

大きく印刷しても鮮明なままですか?
はい。図をピクセルに描き出すのではなく、PDFのベクター命令に翻訳するので、ファイルの中に使い切ってしまう解像度がそもそもありません。同じPDFが、名刺のロゴとしても2メートルの横断幕としてもきれいに刷れます。PNGを書き出すのではなくSVGを変換する理由は、まさにそこにあります。
「描けなかったものがある」と表示されました。どういう意味ですか?
PDFに相当するものがないSVGの機能を、そのファイルが使っているという意味です。フィルター、マスク、複雑なクリップパス、グラデーション、パターン、マーカー、use参照、foreignObject、アニメーションなどです。平らに描いてしまってあとから不思議に思わせるより、飛ばしたものの名前をお伝えします。お使いの描画ソフトでそれらを平坦化するか展開してから、もう一度変換してください。
SVGの中の文字はどうなりますか?
本物のPDFのテキストとして描かれるので、できあがったファイルでも選択と検索ができます。ただしファイルが指定しているフォントは埋め込まれません。フォントファミリー名はゴシック・明朝・等幅のいずれかに対応付けられ、文字幅はブラウザーの描画とは変わります。ラベルを置いた位置がそのままでなければ困る図では、変換する前に文字をアウトライン化してください。
ページの大きさはどうなりますか?
「図に合わせる」なら、図の大きさに余白2つ分を足した、ちょうどの大きさです。大きさはファイルのwidthとheight、またはviewBoxから取ります。どちらも書かれていないSVGは300×150ポイントになります。これはこの形式自身の既定値で、たいていは手書きされたファイルである印です。A4・レター・A3を選ぶと、その用紙の中央に図が置かれます。
作った画像はアップロードされますか?
されません。SVGの解析もPDFへの描画もブラウザーの中で行われ、ファイルに関するものは何一つ送信されません。だからこそ、リンクされた画像を取ってくることもできません。それはこのツールが拒んでいる通信そのものだからです。このページが読み込む唯一の素材は、このサイト自身のオリジンにあるNotoのフォントで、それも図に文字があるときだけです。

関連ツール