Inkscape.org
Beyond the Basics Issue when calling inkscape from docker
  1. #1
    unlocomqx unlocomqx @unlocomqx
    *

    Hi,

    When I execute this command

    docker run -i -v /var/www/html/designer:/var/www/html/designer uvarc/inkscape:1.0 /usr/bin/inkscape /var/www/html/designer/designer/output/18-design18/0-side0/design-18-0.svg --export-filename=/var/www/html/designer/designer/cache/pdfs-18/design-18-0.pdf

    I get this error

    ConcreteInkscapeApplication<Gtk::Application>::on_open: Can't use '--export-filename' with multiple input files (output file would be overwritten for each input file). Please use '--export-type' instead and rename manually.

    I'm passing only 1 input file but I might be missing something

    Any hint is much appreciated

    Thank you

  2. #2
    ML ML @em1000

    Hi unlocompqx,

    This question is beyond my experience level, but I can tell you that I found inklinea's Command Line Builder tool very helpful in rooting out command line syntax issues. Good luck!

    --ML

  3. #3
    unlocomqx unlocomqx @unlocomqx

    Thank you for your reply,

    The command works "locally" and only causes a problem on docker.

    So this command works fine

    inkscape /var/www/html/designer/designer/output/18-design18/0-side0/design-18-0.svg --export-filename=/var/www/html/designer/designer/cache/pdfs-18/design-18-0.pdf

    I will try passing it to sh and see how it goes

  4. #4
    ML ML @em1000

    I wish I could be more helpful. Good luck with your venture. Hopefully the sh doesn't hit the fan! Out of pure curiosity, what sort of a contraption are you building that uses docker to package it up, but needs to convert svgs to pdf with inkscape? If your current approach doesn't work, I wonder if you could use ImageMagick or another utility for the export, although I'm not sure if the output quality is as good using ImageMagick, compared to Inkscape.

  5. #5
    unlocomqx unlocomqx @unlocomqx

    It's a product designer module that generates a SVG then gives the option to download a PDF in the admin panel. Some merchants have debian on the server so they can't install inkscape 1.0 yet, that's why I tried using docker

    Currently, I'm using `--export-type=pdf` without `--export-filename` in order to avoid the issue.
    I'm comfortable with inkscape 1.0 because it supports embedded fonts in SVG

    em1000

    Hopefully the sh doesn't hit the fan! 

    Pun indented 😅

  6. #6
    inklinea inklinea @inklinea⛰️

    Many thanks for the kind words em1000 :)

    I didn't know that Inkscape supported embedded fonts ?  Export to pdf may embed them, but I haven't seen Inkscape embedding them ? 

    If you can't use Inkscape and you want to convert svg to pdf, have you tried using rsvg-convert ?

    rsvg-convert --format pdf in.svg > out.pdf

    That may do what you want ( excluding some filters ) without needing to use Inkscape at all.

  7. #7
    unlocomqx unlocomqx @unlocomqx

    Thank you inklinea, I will try the rsvg approach and see how it goes

    I'm building the SVG using php/smarty so I base64 encode the fonts inside the file, then I don't need to worry about the fonts being installed on the server, I just pass the svg to inkscape and it converts it

    They started supporting embedded fonts in SVg since 1.0

    Cheers

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Issue when calling inkscape from docker