Inkscape <=0.91 파일을 새로운 0.92 CSS 형식으로 자동 변환

Inkscape <=0.91 파일을 새로운 0.92 CSS 형식으로 자동 변환

Inkscape 0.92는 이전 파일을 일치하도록 변환해야 하는지 사용자에게 묻습니다.새로운 결심.

팝업 선택

모든 오래된 사진을 밀리미터 단위로 정렬했습니다. 스크립트를 사용하여 모든 이전 파일을 변환하는 방법은 무엇입니까? 명령줄에서 사용할 수 있는 inkscape 매개변수가 있습니까?

find -name "*.svg" | xargs inkscape ...

답변1

파일을 보면 명령줄에서 파일을 변환할 수 있습니다.

/usr/share/inkscape/extensions/dpiswitcher.py

(또는 설치 장소와 유사한 위치) 이는 변환을 수행하는 코드로 보이며 inkscape 외부에서 실행되는 것으로 보입니다. svg 파일의 이름을 인수로 지정하고 다음 차이점을 사용하여 stdout에 버전을 작성합니다.

$ dpiswitcher.py /tmp/drawing.svg  >/tmp/new.svg
$ xmltidy  /tmp/new.svg 
$ xmltidy  /tmp/drawing.svg 
$ diff /tmp/drawing.svg  /tmp/new.svg

< <svg ... width="210mm" height="297mm" viewBox="0 0 744.09448819 1052.3622047" id="svg3336" version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="drawing.svg">
---
> <svg ... width="793.700787417" height="1122.51968506" viewBox="0.0 0.0 793.700787403 1122.51968501" id="svg3336" version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="drawing.svg">
17c17
<   <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
---
>   <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="matrix(1.066667,0.000000,0.000000,1.066667,0.000000,0.000000)">

내장된 도움말은 다음과 같습니다.

$ dpiswitcher.py --help
Usage: dpiswitcher.py [options] SVGfile
Options:
  --id=IDS              id attribute of object to manipulate
  --selected-nodes=SELECTED_NODES
            id:subpath:position of selected nodes, if any
  --switcher=SWITCHER   Select the DPI switch you want
  --action=ACTION       

전환기와 작업을 기본값으로 설정할 수 있지만 ID와 노드 목록을 제공해야 할 수도 있습니다. 어쩌면 gui를 사용하여 일부 파일을 변환한 다음 이 Python 스크립트를 사용하면 차이점이 있는지 확인하고 단계별로 솔루션을 찾을 수 있습니다.

관련 정보