Inkscape.org
Beginners' Questions inkview: command is not found
  1. #1
    pozitron57 pozitron57 @pozitron57
    *

    I am using Inkscape 1.3.2 (091e20e, 2023-11-25) on Mac Air with M2 Apple chip with OS Ventura 13.5.

    I want to use inkview to view svg files but my terminal says that command is not found. I don't think it is related to common path issue since 'inkscape' is known to the terminal and runs correctly.

    Is there other way to start inkview from command line? Or why it is not working for me?

  2. #2
    m1981 m1981 @m1981

    Hi @pozitron57,

    I'm on 1.3.2, but Windows so I'm not sure we are in the same case. On my system, I find Inkview program in the same folder as the Inkscape executable.
    Do you find it in yours if you browse to it ? If not, maybe a reinstallation of Inkscape should fix that.

    If you correctly see Inkview in it, maybe a trick with the Mac command-line.
    On Windows, either the program is in a Windows well-known path and I can run it from any path, or I can always launch it from its full path.

    Hope it will help.

  3. #3
    Paddy_CAD Paddy_CAD @Paddy_CAD

    A quick Finder search reveals that the macos Inkscape.app package contains no files named Inkview. It seems windows & linux are the only supported platforms. Not a developer. Don't know why.

  4. #4
    Polygon Polygon @Polygon🌶

    I´m not under the impression this is needed on macOS at all having built in Preview.app. https://wiki.inkscape.org/wiki/index.php/Inkview

  5. #5
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Preview doesn't open svg images on my machine. (MacOS Sonoma, 2012 MacBook Pro)

  6. #6
    Polygon Polygon @Polygon🌶

    Ouch - I mixed QickView (Space Bar) with Preview. 🤪

  7. #7
    pozitron57 pozitron57 @pozitron57

    Thanks for the idea to use Quick Look (which is normally launched by Space bar in Finder in Mac). It can be launched by terminal via `qlmanage -p file.svg`. I am actually looking for the simple svg viewer which can view any svg (version 1, version 2, optimized, svgz...). Inkscape can handle it all, but I don't want to start Inkscape any time I just want to view the file. I use Gapplin on Mac, but there are some things I don't like about it (zoom is not working perfectly). `Vimiv` is great but it can't show svg 2.0 and optimized svg files. Quick Look unfortunately can't change zoom. So I am still looking for a simple and fast svg viewer. Thanks for your replies.

  8. #8
    Tyler Durden Tyler Durden @TylerDurden

    Browser?

     

  9. #9
    pozitron57 pozitron57 @pozitron57
    🆒

    Thanks for the suggestion. I don't like to use browser as svg user for several reasons:

    1. I have it open maximised on a separate desktop and don't want to switch there to view the file.

    2. It doesn't show border around svg.

    Funny enough, after having that written I managed to solve both issues.

    1. Command "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --new-window --disable-session-crashed-bubble --disable-infobars --app=file:/path/to/file.svg opens a file in a new window in an only tab whether the chrome was already launched or not.

    2. Create a template.html containing

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>YOUR_SVG_FILE.svg</title>
      <style>
        .svg-container {
          display: inline-block;
          border: 1px solid black;
        }
      </style>
    </head>
    <body>
      <div class="svg-container">
        <object id="svg-object" type="image/svg+xml" data="YOUR_SVG_FILE.svg"></object>
      </div>
    </body>
    </html>
    

    and launch chrome from terminal via

    cp /path/to/template.html /tmp/temp_svg.html && sed -i '' -e 's#YOUR_SVG_FILE.svg#/path/to/file.svg#g' /tmp/temp_svg.html && "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --new-window --disable-session-crashed-bubble --disable-infobars --app=file:///tmp/temp_svg.htm

    Since I use vifm file manager, I made a mapping (need to replace /path/to/template.html to an actual path):

    map \c :!cp /path/to/template.html /tmp/temp_svg.html && sed -i '' -e 's#YOUR_SVG_FILE.svg#%d/%c#g' /tmp/temp_svg.html && "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --new-window --disable-session-crashed-bubble --disable-infobars --app=file:///tmp/temp_svg.html 2>/dev/null &<cr>
    

    So, thanks again for the suggestion. I knew of course that I can use browser as an svg viewer but your suggestion motivated me to tweak it as needed :)