Inkscape.org
  1. #1
    ElRudi ElRudi @ElRudi
    *

    I have an HTML file with many boxes with a border. I want to convert this file into a vector format for laser cutting. This requires the borders to be *paths*, i.e., without an area.

    I've tried evopdf and many other similar conversion sites, tools like webvector, cutycapt, wkhtmltopdf, but none works sufficiently well and often the result looks only vaguely like what the browser renders.

    What works best is to have the browser (firefox) render the page and then use "print as pdf". I then import the resulting file into inkscape, which looks the way it did in the browser, and has the correct sizes as were set in the html file (they were set in mm). The only issue is that the borders are not paths, but long thin rectangles:

    fill, not stroke

    Is there a way to change/convert these somehow? (For example with a script "if aspect ratio > 20, create a path running through the symmetry axis".)

     

    PS: I assume the problem is not caused by inkscape, but rather by the 'print as pdf' printer. However, I have not found any pdf printer that does not have this issue, which is why I'm trying to correct it in inkscape

    PPS: full disclosure, I've also asked this question on stackexchange.

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    One workaround would be to open the pdf in Inkscape, group all objects (probably are already), take a snapshot (Alt+B), then use the centerline-trace in the trace bitmap dialog.

  3. #3
    ElRudi ElRudi @ElRudi

    Hey Tyler,

    Many thanks for your answer. I considered that - but rasterizing is really my last resort. All my boxes are painstakingly positioned at the exact location they are wanted. Rasterizing and then tracing will surely introduce rounding/discretisation errors.

     

     

  4. #4
    ElRudi ElRudi @ElRudi

    (It doesn't help that my project is 1 m tall)

  5. #5
    Aero Aero @Aero◻️

    I can only reproduce your issue printing to pdf from Firefox. Works fine in Edge and Chrome printing to the same pdf printer.
     

  6. #6
    Patrick Storz Patrick Storz @Ede_123

    I recently discovered https://addons.mozilla.org/en-US/firefox/addon/svg-screenshots/ which works at least some of the time.

  7. #7
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Here's a workaround that preserves the border geometry, but I can't honestly call it a shortcut.  It's fine if you're converting a dozen boxes but maybe not if you're repeatedly converting hundreds of boxes.

    New Borders Please
  8. #8
    Paddy_CAD Paddy_CAD @Paddy_CAD

    #6: Thanks Patrick for that svg screenshot link.  An excellent addition to my collection.