title: How to convert 10MB PDF to SVG quickly with appropriate size for web
body: <p>Good day, I have read all questions and answers about "PDF to SVG", "PDF to PNG, PNG to SVG" and had no success in accomplishing my task.</p>
  
  <p>I have a PDF that is about 10mb (blueprints from archiCAD) and after using pdf2svg to convert to SVG, the SVG is about 70mb. Conversion takes 14sec, but the web page load takes about 150sec because of the size of the SVG.</p>
  
  <p>My question is - how can i convert PDF in PHP to SVG with appropriate size for web without quality loss and without gzipping it?</p>
  
  <p>This code converts PDF to SVG that is 70MB:</p>
  
  <pre><code>$fileName = 'in.pdf';
  $targetName = 'out.svg';
  exec("pdf2svg ".escapeshellarg($fileName)." ".escapeshellarg($targetName));
  </code></pre>
  
  <p>This one converts PDF to 500kb SVG with HUGE quality loss, some path loss, text loss, etc.</p>
  
  <pre><code>exec("convert -density 200 ".escapeshellarg($fileName)." middle.png");
  exec("inkscape middle.png --export-plain-svg=".escapeshellarg($targetName));
  </code></pre>
  
  <p>Ive tried imagemagick, autotrace, potrace, inkscape, pdf2svg.
  I tried the answer from "<a href="https://stackoverflow.com/questions/4120567/convert-pdf-to-svg">convert pdf to svg</a>". Other questions (on SO) weren't even close to what I need.</p>
  
  <p>I've read almost every link on Google and almost every topic accomplish my task, but they all start with a with small size PDF so it doesn't solve my problem.</p>