ข้ามไปยังเนื้อหา

SVG เป็น PDF

แปลงงานกราฟิกเวกเตอร์เป็น PDF โดยไม่เปลี่ยนให้เป็นพิกเซล

ประมวลผลบนเครื่องของคุณ

เครื่องมือนี้ทำงานในเบราว์เซอร์ของคุณทั้งหมด ไฟล์ของคุณไม่ถูกอัปโหลดเลย และคุณตรวจสอบได้เองในแท็บเครือข่ายของเบราว์เซอร์ ตรวจสอบด้วยตัวเอง เปิดแท็บเครือข่ายของเบราว์เซอร์แล้วดู คุณจะเห็นคำขอเล็ก ๆ หนึ่งรายการที่ถามว่าคุณยังมีโควตางานเหลืออยู่หรือไม่ ซึ่งมีแค่ชื่อเครื่องมือกับค่าแฮช ไม่ใช่ตัวไฟล์

เครื่องมือนี้ทำอะไร

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 แทนที่จะถูกเรนเดอร์เป็นพิกเซล ไฟล์จึงไม่มีความละเอียดที่จะหมดลง PDF ไฟล์เดียวกันพิมพ์ออกมาสะอาดทั้งเป็นโลโก้บนนามบัตรและเป็นป้ายขนาดสองเมตร ซึ่งเป็นเหตุผลทั้งหมดของการแปลง SVG แทนที่จะส่งออกเป็น PNG
ผลลัพธ์บอกว่ามีบางอย่างวาดไม่ได้ หมายความว่าอย่างไร
หมายความว่าไฟล์ใช้คุณสมบัติของ SVG ที่ไม่มีสิ่งเทียบเท่าใน PDF เช่น ฟิลเตอร์ มาสก์ การไล่ระดับสี ลวดลาย เส้นตัดที่ซับซ้อน มาร์กเกอร์ การอ้างอิงด้วย use, foreignObject หรือภาพเคลื่อนไหว แทนที่จะวาดออกมาแบน ๆ แล้วปล่อยให้คุณสงสัยว่าทำไมงานดูผิด ตัวแปลงจะบอกชื่อสิ่งที่ข้ามไป ให้แปลงหรือขยายองค์ประกอบเหล่านั้นในโปรแกรมวาดของคุณแล้วแปลงอีกครั้ง
ข้อความใน SVG ของฉันจะเป็นอย่างไร
ถูกวาดเป็นข้อความจริงของ PDF จึงยังเลือกและค้นหาได้ในไฟล์ที่เสร็จแล้ว แต่ฟอนต์ในไฟล์ไม่ถูกฝังลงไป ชื่อตระกูลฟอนต์จะถูกจับคู่กับซานส์ เซริฟ หรือโมโนสเปซ และความกว้างจะต่างจากที่เบราว์เซอร์วาด สำหรับงานที่ป้ายข้อความต้องอยู่ตรงตำแหน่งที่คุณวางไว้พอดี ให้แปลงข้อความเป็นเส้นขอบก่อนแล้วค่อยแปลงไฟล์
หน้ากระดาษจะมีขนาดเท่าไร
ถ้าเลือกตามภาพวาด จะเท่ากับขนาดของภาพวาดบวกระยะขอบสองเท่าพอดี โดยอ่านจากค่า width และ height ของไฟล์ หรือจาก viewBox ไฟล์ SVG ที่ไม่ได้ระบุทั้งสองอย่างจะกลับไปใช้ 300 คูณ 150 พอยต์ ซึ่งเป็นค่าเริ่มต้นของรูปแบบนี้เอง และมักเป็นสัญญาณว่าไฟล์ถูกเขียนด้วยมือ ถ้าเลือก A4 Letter หรือ A3 คุณจะได้กระดาษแผ่นนั้นโดยวางภาพวาดไว้กลางหน้า
งานกราฟิกของฉันถูกอัปโหลดไหม
ไม่ ไฟล์ SVG ถูกแยกวิเคราะห์และวาดลงใน PDF ภายในเบราว์เซอร์ของคุณ และไม่มีข้อมูลใดเกี่ยวกับไฟล์ถูกส่งออกไป นั่นแปลว่ารูปภาพที่ลิงก์ไว้ก็ถูกดึงมาไม่ได้เช่นกัน เพราะนั่นคือคำขอที่เครื่องมือนี้ปฏิเสธจะส่ง สิ่งเดียวที่หน้านี้โหลดคือฟอนต์ Noto จากโดเมนของเว็บไซต์นี้เอง และโหลดเฉพาะเมื่อภาพวาดมีข้อความอยู่

เครื่องมือที่เกี่ยวข้อง