InkScape is a very useful tool to create visuals and documents. A boring task with InkScape is the exportation to PNG or PDF. A simple PowerShell script can help quickly export evcey SVG from a directory.
Demonstration :
SVG to PNG
param ($dpi = 90)
set-alias inkscape "C:\Program Files\Inkscape\inkscape.exe"
Get-ChildItem -Filter *.svg | % {
$src = $_.FullName
$dst = $src -replace "\.svg$", ".png"
"inkscape -f $($src) -e $($dst) -d $($dpi)"
inkscape -f "$($src)" -e "$($dst)" -d "$($dpi)"
}
Write-Host "done !"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
SVG vers PDF
Nota bene : the option -T
forces fonts to be converted to vectorial so there is no problem with exotic fonts.
param()
set-alias inkscape "C:\Program Files (x86)\Inkscape\inkscape.exe"
Get-ChildItem -Filter *.svg | % {
$src = $_.FullName
$dst = $src -replace "\.svg$", ".pdf"
"inkscape -f $($src) -A $($dst) -T"
inkscape -f "$($src)" -A "$($dst)" -T
}
Write-Host "done !"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")