Strange command line behaviour with PS import / SVG export

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

Bug Description

Under Win7 I observed the following strange and illogic behaviour:

Converting PDF to SVG seems to work this way:
inkscape.exe -z -f "Input.pdf" -l "Output.svg"

With a Postscript (PS) file this doesn't work. Nothing happens (under Win7)!
inkscape.exe -z -f "Input.ps" -l "Output.svg"

However, what seems to work is the following with PS:
inkscape -z -f "Input.ps" -l "Output.svg"

Find the difference! Why should the extension ".exe" make a difference but only with PS files?
Bug or feature? Can others reproduce this on Win7?

A related issue is with cropping to bounding box. Look at the following codes:
1) inkscape -z -f "Input.ps" -E "Output.eps" -A "Output.pdf" -l "Ouput.svg"
2) inkscape -z -f "Input.ps" -E "Output.eps" -l "Ouput.svg"
3) inkscape -z -f "Input.ps" -A "Output.pdf"
4) inkscape -z -f "Input.ps" -l "Ouput.svg"
5) inkscape -z -f "Input.eps" -l "Ouput.svg"

ad 1) EPS and PDF are cropped, SVG is not (why is the PDF cropped and the SVG not?)
ad 2) EPS is cropped, SVG is not (why is the SVG not cropped?)
ad 3) PDF is not cropped (well, here I wouldn't expect it, although an option to do so would be nice!)
ad 4) SVG is not cropped (well, here I wouldn't expect it, although an option to do so would be nice!)
ad 5) SVG is cropped (as expected!)

So, if I want a cropped SVG from PS, I have to start Inkscape twice: first to create an EPS and second to load the cropped EPS again and create an SVG, which makes everything slow and inefficient for a large number of conversions.
But why then is the PDF cropped after creation of an EPS in the same line?
How much effort would it be to have the SVG cropped either after creation of an EPS in the same line or alternatively as an option "c" for cropping, e.g. "-lc" and "-Ac" for a cropped PDF without having to create an EPS first?
Thanks!

Revision history for this message
theozh (theozh) wrote :

The described behaviour is actually observed with Inkscape 0.91 under Win7/64

Furthermore, you can try this:

1) inkscape.exe -f "Input.ps"
2) inkscape.exe "Input.ps"
3) inkscape -f "Input.ps"
4) inkscape "Input.ps"

1) and 2) end up with an error messages:
"Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected"
and
"Failed to load the requested file Input.ps"

whereas 3) and 4) are correctly opening the file Input.ps.

Revision history for this message
Alvin Penner (apenner) wrote :

thank you for taking the time to issue a report.

I did my testing with Windows 10, Inkscape 0.92.0 r15299 (32 bit exe build)

problem not reproduced with the following set of commands, where the starting directory is the inkscape directory

C:\Program Files (x86)\Inkscape>inkscape.exe -z -f "\windows\temp\input.pdf" -l "\windows\temp\outputpdf.svg"
C:\Program Files (x86)\Inkscape>inkscape.exe -z -f "\windows\temp\input.ps" -l "\windows\temp\outputps.svg"
C:\Program Files (x86)\Inkscape>inkscape -z -f "\windows\temp\input.pdf" -l "\windows\temp\outputpdf.svg"
C:\Program Files (x86)\Inkscape>inkscape -z -f "\windows\temp\input.ps" -l "\windows\temp\outputps.svg"

problem also not reproduced with the following set of commands, where the starting directory is the input file directory

C:\Windows\Temp>\Progra~2\Inkscape\inkscape.exe -z -f "input.pdf" -l "outputpdf.svg"
C:\Windows\Temp>\Progra~2\Inkscape\inkscape.exe -z -f "input.ps" -l "outputps.svg"
C:\Windows\Temp>\Progra~2\Inkscape\inkscape -z -f "input.pdf" -l "outputpdf.svg"
C:\Windows\Temp>\Progra~2\Inkscape\inkscape -z -f "input.ps" -l "outputps.svg"

In all eight cases the commands worked properly, producing output files.

you might want to consider trying the new release of Inkscape, at:
https://inkscape.org/en/download/windows/

su_v (suv-lp)
tags: added: cli eps exporting importing pdf win64
removed: conversion cropping ps-import svg-export
Revision history for this message
theozh (theozh) wrote :

Thanks, Alvin, for looking into this and the hint with the brand new version 0.92
I tried this with Version 0.92 r15299 64bit exe build

I checked just opening (no conversion) via command line:

1) inkscape.exe "Input.pdf"
2) inkscape "Input.pdf"
3) inkscape.exe "Input.ps"
4) inkscape "Input.ps"

ad 1) works
ad 2) works
ad 3) does not work, same error as in comment #1, opening empty Inkscape GUI
ad 4) works (opens PS, however, see strange observations below)

Further observations:
with 1) and 2) Inkscape is started and I get again a cursor at the console. PDF is displayed correctly.
with 4) Inkscape GUI opens and PS is displayed correctly (as far as I can tell) but I do not get the cursor back at the console, however, some Warnings appear in the console:

FontLister::get_best_style_match(): can't find family: Sans

If I ungroup objects and everytime when I click on text objects in the Inkscape GUI it continues to write warnings in the console window partly about fonts which are not at all used in the PS file (see below).
In the GUI the text it is listed as "Times New Roman" displayed correctly, whereas Inkscape is complaining about "TimesNewRoman" without spaces.
Furthermore, the below mentioned fonts "Eurotherm Message Center 9" or "Fixedsys 9" or "Sans" have not been used in the PS file at all. I do not know why Inkscape complains about it.

The warning are for example something like:

** (inkscape.exe:1396): WARNING **: Couldn't find row for font-family: TimesNewR
oman

(inkscape.exe:1396): Pango-WARNING **: couldn't load font "TimesNewRoman Not-Rot
ated 18", falling back to "Sans Not-Rotated 18", expect ugly output.
FontLister::get_best_style_match(): can't find family: Sans

** (inkscape.exe:1396): WARNING **: Couldn't find row for font-family: Sans

(inkscape.exe:1396): Pango-WARNING **: couldn't load font "Eurotherm Message Cen
ter 9", falling back to "Sans 9", expect ugly output.

(inkscape.exe:1396): Pango-WARNING **: couldn't load font "Fixedsys 9", falling
back to "Sans 9", expect ugly output.

** (inkscape.exe:1396): WARNING **: Couldn't find row for font-family: Sans

** (inkscape.exe:1396): WARNING **: Couldn't find row for font-family: Sans
FontLister::get_best_style_match(): can't find family: TimesNewRoman

So, obviously, PS-Files are confusing and messing up Inkscape. But I do not know why and whether it's just a Win7-issue, PS-issue... or even worse, just on my PC?

Revision history for this message
Alvin Penner (apenner) wrote :

hello again,
    from the syntax you are using in your commands, I gather that you have probably put the Inkscape directory into the PATH variable on your computer, otherwise you would have had to write out the exact directory location explicitly in your commands. I normally do not do that. I prefer to leave Inkscape absent from the PATH and write in the exact location explicitly. However even if I temporarily put Inkscape into the path, I am still not able to duplicate the problem you are having. So I am confused.
    as an experiment you could try changing directory so that you are exactly in the Inkscape directory and then try running the commands. In this case the PATH variable will not be used, or will not be needed.
     somewhat off-topic, there is a difference between the command 'inkscape.exe' and 'inkscape' in all cases. The command inkscape.exe runs the file inkscape.exe directly and it runs it outside of DOS. Meaning that you will regain the DOS cursor immediately even while Inkscape is running. And also that you will not see any of the error messages that Inkscape produces.
    The command 'inkscape' actually runs the file inkscape.com which then calls inkscape.exe. In this case you will _not_ get a DOS cursor until Inkscape exits, and you _will_ get the error messages that Inkscape produces. I have forgotten the technical term for it, but it is similar to the difference between a modal versus non-modal dialog. Normally running 'inkscape' is "better" because you get more info. However this is probably why the .ps input is being affected, even though I have not been able to reproduce the problem. What I would try however is to run Inkscape from within its own directory as a trial. That way you do not need a PATH assignment.

Revision history for this message
theozh (theozh) wrote :

Thanks again,
well, I didn't know that there is a difference (and what it is) between "inkscape", "inkscape.exe" and "inkscape.com". (Probably, that's Windows basics of which I was not aware of).

I tested under Win10 with Inkscape0.91 and I cannot reproduce it.
1) "C:\Program Files\Inkscape\inkscape.exe" Input.ps
2) "C:\Program Files\Inkscape\inkscape" Input.ps

ad 1) Starts Inkscape, displays the file and you get the cursor back at the console immediately
ad 2) Starts Inkscape, gives some Warnings, displays the file, cursor not back to the console unless you terminate Inkscape

So, then this probably seems to be a Win7 issue?!

However, when I open the file under Win7 e.g. with notepad++

1) "C:\Program Files (x86)\Notepad++\notepad++.exe" Input.ps
2) "C:\Program Files (x86)\Notepad++\notepad++" Input.ps

I do not see any difference, so it still seems to be somehow an Inkscape-related issue?!

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

Other bug subscribers

Remote bug watches

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