Book a Demo

Author Topic: Extend Image Library  (Read 3678 times)

milan.petrak

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Extend Image Library
« on: March 06, 2019, 11:01:41 pm »
Some time is good to have more vector images form another GNU projects

OSA
https://www.opensecurityarchitecture.org/cms/library/icon-library
XML to import as a reference data
https://drive.google.com/open?id=1Rv-roVrXgC5-XMVqmf6ex-goLBouTOKB

VRT
https://github.com/klump/vrt-sheet-for-dia/tree/new-svg
XML to import as a reference data
https://drive.google.com/open?id=1aCBVzYMX2DBw365BUeKDPiThlJJv0Shv

If you will need create another libraries

You will need inkscape as a svg to emf convertor
https://inkscape.org/

script prepare.bat
Code: [Select]
for /R %%f in (*.svg) do (
"C:\Program Files\Inkscape\inkscape" --file %%~NXf --export-emf %%~Nf.emf
)


type header.xml > ImageLibrary.xml

del data.b64
del tmp.b64

setlocal enabledelayedexpansion
for /R %%f in (*.emf) do (
set /A Counter+=1
echo ^<DataRow^> >> ImageLibrary.xml
echo ^<Column name=^"ImageID^" value=^"!Counter!^"^/^> >> ImageLibrary.xml
echo ^<Column name=^"Name^" value=^"%%~Nf^"^/^> >> ImageLibrary.xml
echo ^<Column name=^"Type^" value=^"Metafile^"^/^> >> ImageLibrary.xml
echo ^<Column name=^"Image^" xmlns:dt=^"urn:schemas-microsoft-com:datatypes^" dt:dt=^"bin.base64^"^> >> ImageLibrary.xml
certutil -encode %%f tmp.b64 && findstr /v /c:- tmp.b64 > data.b64
type data.b64 >> ImageLibrary.xml
echo ^<^/Column^> >> ImageLibrary.xml
echo ^<^/DataRow^> >> ImageLibrary.xml

del data.b64
del tmp.b64
 )
endlocal
type footer.xml >> ImageLibrary.xml

header.xml file

Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<RefData version="1.0" exporter="EA.25">
<DataSet name="VRT Images" table="t_image" filter="Name='#Name#'" stoplist=";ImageID;">

footer.xml file

Code: [Select]
</DataSet>
</RefData>


Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Extend Image Library
« Reply #1 on: March 07, 2019, 06:27:04 am »
Thanks for sharing
Happy to help
:)