Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vesa Oikonen
svg2png
Commits
6ebddd72
Commit
6ebddd72
authored
Aug 25, 2017
by
Vesa Oikonen
Browse files
Add new file
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
svg2png.bat
0 → 100644
View file @
6ebddd72
@echo
off
setlocal
enableExtensions
enableDelayedExpansion
set
PROGNAME
=
"D:\Program Files\Inkscape\inkscape.exe"
if
"
%
1"
==
"-h"
goto
USER_INFO
if
"
%
1"
==
"--help"
goto
USER_INFO
if
not
"
%
2"
==
""
goto
USER_INFO
if
"
%
1"
==
""
goto
DO_ALL
set
SFILE
=
%
1
set
BNAME
=
!
SFILE
:
~
0
,-
4
!
@echo
!SFILE!
to
!BNAME!
.png
call
!PROGNAME!
-z -e
"
!BNAME!
.png"
-w
600
-d
300
-b
white
"
!SFILE!
"
if
not
%errorlevel%
==
0
(
@echo
Error
exit
/b
1
)
goto
END
:DO
_ALL
for
/r
%%P
in
(*
.svg
)
do
(
set
SFILE
=
%%P
set
BNAME
=
!
SFILE
:
~
0
,-
4
!
@echo
!SFILE!
to
!BNAME!
.png
call
!PROGNAME!
-z -e
"
!BNAME!
.png"
-w
600
-d
300
-b
white
"
!SFILE!
"
if
not
!errorlevel!
==
0
(
@echo
Error
exit
/b
1
)
)
goto
END
:USER
_INFO
@echo.
@echo
svg2png
@echo.
@echo
Convert
SVG
file
(
s
)
to
PNG
format
using
Inkscape
.
@echo
Inkscape
must
be
installed
,
and
the
correct
path
for
executable
file
must
be
@echo
defined
in
the
start
of
this
batch
file
.
Note
that
you
cannot
install
@echo
Inkscape
from
Microsoft
Store
.
@echo.
@echo
With
no
command
-ine
argument
all
SVG
files
are
recursively
converted
to
SVG
files
.
@echo
Alternatively
,
the
name
of
single
SVG
file
can
be
entered
.
@echo.
goto
END
:END
exit
/b
0
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment