{"slug": "why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-svg", "title": "Why Converting a PNG or AI Logo to SVG Usually Fails at Print Shops (And a 6-Point SVG Pre-Flight Check)", "summary": "A developer at LogoNib built a browser-based SVG pre-flight inspector that audits logo files for the defects most commonly rejected by print shops: base64-encoded PNGs wrapped in an SVG container, live text elements that silently swap fonts, and noisy or malformed vector paths. The tool, written in pure TypeScript using DOMParser, counts live text nodes, embedded rasters and vector primitives, and checks for a viewBox and NaN path coordinates. The developer also warns that untrusted SVGs should never be rendered via innerHTML or same-origin Blob URLs because inline scripts and event handlers execute inside SVG documents.", "body_md": "Every week, founders generate a logo as a `1024×1024` PNG—from an AI image generator, a slide deck, or a quick web mockup—run it through the first \"PNG to SVG converter\" they find on Google, and upload the result to a print shop for business cards, signage, or merch.\n\nA day later, pre-press rejects the file.\n\nAlmost every rejection comes down to one of three hidden defects inside the `.svg` file. None of them are obvious when you preview the logo in Chrome on a laptop.\n\n`<svg>`)\nA surprising number of free \"PNG to SVG\" tools do not trace vectors at all. They base64-encode your raster PNG and wrap it inside a 4-line SVG container:\n\n```\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"512\" height=\"512\" viewBox=\"0 0 512 512\">\n  <image width=\"512\" height=\"512\" href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\" />\n</svg>\n```\n\nBecause the filename ends in `.svg`, it looks right on a screen. At 300 DPI print resolution, however, a `512px` embedded bitmap can only print `1.71 inches` wide (`512 ÷ 300 = 1.71\"`). Stretch it across a `12\"` tote bag or a `36\"` trade-show banner and every edge turns blurry. Vinyl cutters and embroidery digitizers reject `<image>` tags outright because there are no vector cut paths to follow.\n\n`<text>` Tags That Silently Swap Fonts\nWhen a browser tool or design app exports a logo with live `<text font-family=\"Fraunces\">` elements, the SVG does not carry the font file inside it. It relies on the recipient's computer having that exact font installed.\n\nWhen a print shop opens the file in Illustrator or CorelDRAW without your font installed, the software silently substitutes Arial or Helvetica—wrecking letter spacing, line width, and emblem alignment.\n\nProduction vector logos convert every character into closed `<path d=\"...\">` outlines using font glyph geometry (for example via `opentype.js`) before export. Once outlined, `<text>` count is `0`, and the logo renders identically on every RIP, plotter, and browser forever.\n\nEven real bitmap tracers (Potrace, Image Trace, and ML vectorizers) struggle with small wordmarks and AI-generated logos:\n\n`e`, `a`, and `o` pinch shut or produce self-intersecting subpaths.`400+` noisy anchor points that stall vinyl plotters and bloat web bundles.\nWhen we built the pre-flight inspector for [LogoNib](https://www.logonib.com), we wrote a small pure-TypeScript DOM audit that runs locally in the browser via `DOMParser` (`image/svg+xml`). Here is the core check pattern:\n\n``` js\nexport function auditLogoSvg(rawSvg: string) {\n  const doc = new DOMParser().parseFromString(rawSvg, 'image/svg+xml');\n  const root = doc.documentElement;\n\n  const liveTextNodes = root.querySelectorAll('text, tspan, textPath').length;\n  const embeddedRasters = root.querySelectorAll('image').length;\n  const vectorPrimitives = root.querySelectorAll(\n    'path, circle, rect, ellipse, polygon, polyline'\n  ).length;\n  const hasViewBox = Boolean(root.getAttribute('viewBox')?.trim());\n  const hasNaNPaths = Array.from(root.querySelectorAll('path')).some((p) =>\n    /\\bNaN\\b/i.test(p.getAttribute('d') ?? '')\n  );\n\n  return {\n    liveTextNodes,      // Must be 0 for print-ready outlined SVG\n    embeddedRasters,    // Must be 0 (catches fake wrapped-PNG SVGs)\n    vectorPrimitives,   // Should be > 0 real geometry elements\n    hasViewBox,         // Required for predictable scaling\n    hasNaNPaths         // Catches malformed path coordinates\n  };\n}\n```\n\nOne important browser security detail if you build your own SVG tool: **never** render untrusted user SVGs via `innerHTML`, `{@html}`, or a same-origin `image/svg+xml` Blob URL (inline `<script>` tags and `onload` handlers execute inside SVG documents). Instead, strip scripts/event handlers first and rasterize the preview onto an offscreen `<canvas>` before emitting a safe `image/png` Blob URL.\n\nBefore uploading your logo to a printer, merch vendor, or sign shop, check all six items:\n\n`<path>`.`<image>` embeds`viewBox` attribute`#111111` pure-black (for invoices, stamps, and laser engraving) and `#FFFFFF` pure-white (for dark headers and packaging).`2048px–4000px` wide for Stripe Checkout, slide decks, and social headers.`<= 300%` + WCAG 2.1 contrast\nIf you already have a logo SVG and want to audit or recolor it right now without installing Illustrator or creating an account, all of our pre-press utilities run 100% locally in your browser:\n\n`NaN` path bugs in one click.`2048px` or `4000px` transparent PNGs locally.`300%`.\nFor the full engineering breakdown—including DPI print-size tables and a side-by-side comparison of bitmap tracing vs manual redraw vs native OpenType outlining—read the complete guide: **[How to Convert a PNG or AI Logo to Print-Ready Vector SVG](https://www.logonib.com/guides/convert-png-to-vector-svg)** (and if you are rebuilding an AI raster logo from scratch, see our **[ChatGPT / AI Logo vs Outlined Vector SVG guide](https://www.logonib.com/alternatives/chatgpt-logo-maker)**).\n\nNeed a brand-new outlined vector logo and full brand kit without a subscription? You can test **[LogoNib Studio](https://www.logonib.com)** free on your own company name—and even download a **[free 8-file Alder & Pine sample ZIP](https://www.logonib.com/#specs)** first to inspect the outlined SVGs, 300-DPI bleed PDF, and 4-page brand guide yourself. One-time packs start at `$29` with zero recurring fees and a 30-day refund guarantee.", "url": "https://wpnews.pro/news/why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-svg", "canonical_source": "https://dev.to/hazelfenwick/why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-point-svg-pre-flight-5b0n", "published_at": "2026-11-30 16:41:12+00:00", "updated_at": "2026-11-30 16:46:14.065480+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["LogoNib", "Potrace", "Adobe Illustrator", "CorelDRAW", "opentype.js"], "also_reported_by": [], "takeaway": "Audit print-bound SVGs for zero live text and image elements, a present viewBox, real vector primitives and no NaN path data, and rasterize untrusted SVGs to a canvas instead of injecting them via innerHTML.", "recommendation": {"advice": "Before sending a logo to print, run a DOMParser audit that requires zero text and image nodes, a viewBox and no NaN paths, and preview untrusted SVGs only via canvas rasterization.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-svg", "markdown": "https://wpnews.pro/news/why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-svg.md", "text": "https://wpnews.pro/news/why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-svg.txt", "jsonld": "https://wpnews.pro/news/why-converting-a-png-or-ai-logo-to-svg-usually-fails-at-print-shops-and-a-6-svg.jsonld"}}