Command-line verbs do nothing

Bug #1273352 reported by Tim White
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Steps to reproduce:

inkscape -f test1.svg --verb=EditSelectAll --verb=ObjectRotate90 --export-area-drawing --export-pdf=test1.pdf

Opening test1.pdf shows it to be unrotated.

If instead --shell is used, i.e.:

inkscape --shell
(Following 2 lines entered at Inkscape's ">" prompt:)
-f test1.svg --verb=EditSelectAll --verb=ObjectRotate90 --export-area-drawing --export-pdf=test1.pdf
quit

then after typing the first line, I also see 3 error messages:

** (inkscape.exe:4452): CRITICAL **: Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*): assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed

** (inkscape.exe:4452): CRITICAL **: Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*): assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed

** (inkscape.exe:4452): WARNING **: Specified document FilesInkscapeinkscape.com cannot be opened (does not exist or not a valid SVG file)

The same (lack of) behaviour happens with ObjectFlipHorizontally instead of ObjectRotate90. Also the same behaviour happens for these variations:

test1.svg --verb=EditSelectAll --verb=ObjectRotate90 --export-area-drawing --export-pdf=test1.pdf
--verb=EditSelectAll --verb=ObjectRotate90 --export-area-drawing --export-pdf=test1.pdf test1.svg

My system:
Inkscape 0.48.4 r9939
WinXP SP3

I'm aware of the inkscape .com/.exe issue on Windows; the above tests all use inkscape.com, as recommended. I did however notice that if the first command is changed to inkscape.exe to force the .exe to run, then the same .pdf file is generated -- but this happens almost instantaneously, instead of taking around 1s.

Tags: cli
Revision history for this message
Tim White (inkscape-20-j-random-hacker) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Verbs don't work wiithout GUI (bug #843260), pdf export however disables the GUI -> don't mix verbs with other command line options.

Use separate steps:
$ cp test1.svg test2.svg
$ inkscape -f test2.svg --verb=EditSelectAll --verb=ObjectRotate90 --verb=FileSave --verb=FileQuit
$ inkscape -f test2.svg --export-area-drawing --export-pdf=test2.pdf

Revision history for this message
Tim White (inkscape-20-j-random-hacker) wrote :

Thanks. In fact I don't want to perform any verbs at all -- I only want to export a PDF file that contains connectors in their correct positions (connectors are placed wrongly on load: bug #795627), and one way to do that interactively is to select all objects and perform some no-op edits on them (e.g. rotate CW, then rotate CCW, or Cut then Paste In Place). I was trying to replicate this from the command line.

So unfortunately your workaround won't work for me. Is there some other way to export-as-PDF a drawing with correctly-placed connectors from the command line?

Revision history for this message
su_v (suv-lp) wrote :

Seems that the only other option with Inkscape itself (saving as 'Plain SVG', converting the plain SVG to PDF) fails because somehow the fix for bug #500440 got lost with 0.48.2 and later versions.

You could try running scour [1] as standalone python script to convert the SVG files to 'Optimized SVG' (can't be scripted via cli), and then convert that optimized SVG to PDF (via inkscape cli).

[1] Scour.py is used by Inkscape as output extension for 'Optimized SVG' and has lots of options to clean SVG files.
    <http://codedread.com/scour/>

Revision history for this message
Tim White (inkscape-20-j-random-hacker) wrote :

Many thanks ~suv, that scour did the trick! :) The resulting .svg file has "dumb" arrows instead of connectors, which Inkscape manages to load and export to PDF just fine.

I suppose you can close this bug, as it seems to be the logical consequence of a combination of other bugs that are already in the system.

Revision history for this message
su_v (suv-lp) wrote :

Thx for the feedback - good to know that you found another workaround to deal with those stubborn connectors ;)

> I suppose you can close this bug, as it seems to be the logical
> consequence of a combination of other bugs that are already in the
> system.

I'll rather link it as duplicate to Bug #843260 “Allow suppressing the GUI (-z) when using --verb option(s)”: it matches the first issue of your detailed report most, and includes the reference to bug #626854 (--verb actions not possible in --shell mode).

Feel free to add a comment here (bug #1273352) and revert the duplicate status if you disagree.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.