{"id":22296159,"url":"https://github.com/kakwa/libvisio2svg","last_synced_at":"2025-04-09T17:20:06.980Z","repository":{"id":65612882,"uuid":"51251036","full_name":"kakwa/libvisio2svg","owner":"kakwa","description":"Library/Tools to convert Microsoft (MS) Visio documents (VSS and VSD) to SVG","archived":false,"fork":false,"pushed_at":"2025-03-16T22:07:15.000Z","size":160,"stargazers_count":115,"open_issues_count":6,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T17:20:01.124Z","etag":null,"topics":["c-plus-plus","microsoft","stencil","svg","svg-conversion-library","visio","visio-documents","vsd","vss"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kakwa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-07T14:47:51.000Z","updated_at":"2025-03-16T22:07:10.000Z","dependencies_parsed_at":"2024-06-19T10:09:05.990Z","dependency_job_id":null,"html_url":"https://github.com/kakwa/libvisio2svg","commit_stats":{"total_commits":149,"total_committers":5,"mean_commits":29.8,"dds":0.02684563758389258,"last_synced_commit":"5bc3db730f490e6c3c12e1f83d1286ed2c017d5c"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakwa%2Flibvisio2svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakwa%2Flibvisio2svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakwa%2Flibvisio2svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakwa%2Flibvisio2svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kakwa","download_url":"https://codeload.github.com/kakwa/libvisio2svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074922,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","microsoft","stencil","svg","svg-conversion-library","visio","visio-documents","vsd","vss"],"created_at":"2024-12-03T17:44:25.207Z","updated_at":"2025-04-09T17:20:06.940Z","avatar_url":"https://github.com/kakwa.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Libvisio2svg\n============\n\n[![Build Status](https://travis-ci.org/kakwa/libvisio2svg.svg?branch=master)](https://travis-ci.org/kakwa/libvisio2svg)\n\n\nLibrary/Utilities to convert Microsoft (MS) Visio Documents and Stencils (VSS and VSD) to SVG.\n\nMotivation\n==========\n\nThere are tons of publicly available MS Visio stencils, for example \n[the Cisco ones](http://www.cisco.com/c/en/us/products/visio-stencil-listing.html) \nor the stencils from [VisioCafe](http://www.visiocafe.com/).\nThis library and utilities were created to be able to convert these stencils to SVG\nand reuse them outside of Microsoft Visio, in programs like \n[yEd](https://www.yworks.com/products/yed), [Inkscape](https://inkscape.org), \n[Dia](http://dia-installer.de/), [Calligra Flow](https://www.calligra.org/flow/)...\n\nThis library is mainly the glue between [librevenge](http://sourceforge.net/p/libwpd/wiki/librevenge/)/[libvisio](https://github.com/LibreOffice/libvisio), [libemf2svg](https://github.com/kakwa/libemf2svg) and [libwmf](http://wvware.sourceforge.net/libwmf.html).\n\nAbout libemf2svg\n----------------\n\n[libemf2svg](https://github.com/kakwa/libemf2svg) is another library of mine.\nIt was developed to handle MS EMF (Enhanced Metafile) blobs which constitute most of Visio VSS shapes.\n\nLibrevenge/Libvisio would otherwise only dump the EMF blob as base64 in an \\\u003cimage\\\u003e SVG tag, which most viewer/editor/browser\nwould be unable to display.\n\nLicense\n=======\n\nLibvisio2svg is licensed under GPLv2.\n\nDependencies\n============\n\n* [librevenge](http://sourceforge.net/p/libwpd/wiki/librevenge/)\n* [libvisio](https://github.com/LibreOffice/libvisio)\n* [libemf2svg](https://github.com/kakwa/libemf2svg)\n* [libxml2](http://www.xmlsoft.org/)\n* [libwmf](http://wvware.sourceforge.net/libwmf.html)\n* [fonts from the ghostscript project](https://www.ghostscript.com/) (libwmf requirement, usually the distribution package is named `gsfonts`)\n\nBuilding\n========\n\nCommands to build this project:\n\n```bash\n# CMAKE_INSTALL_PREFIX is optional, default is /usr/local/\n$ cmake . -DCMAKE_INSTALL_PREFIX=/usr/\n\n# compilation\n$ make\n\n# installation\n$ make install\n```\n\nRegex\n-----\n\nThe vss2svg and vsd2svg utilities rely on regular expressions to construct safe file names from stencils/sheets names.\nIt will replace anything that is not matching **[A-Za-z0-9-]** by an underscore.\n\nThis functionality relies on regexp from libstdc++ (c++11 standard), but older libraries doesn't support regex.\n\nYet you can compile without this file name sanitization:\n\n```\n$ cmake . -DUNSAFE_FILENAME=ON\n$ make\n```\n\nHowever, be cautious with the stencil/sheet names, otherwise some files might be written outside the output directory.\n\nUsage\n=====\n\nCommand Line\n------------\n\nConvert VSS:\n\n```bash\n# conversion\n$ vss2svg-conv -i ./2960CX.vss -o ./out/ -s 4.5\n\n$ ls out/\n'Cisco R42610 Front.svg'      'WS-C2960CX-8PC-L Rear.svg'   'WS-C2960CX-8TC-L Rear.svg'\n'WS-C2960CX-8PC-L Front.svg'  'WS-C2960CX-8TC-L Front.svg'\n\n# help\n$ vss2svg-conv --help\n```\n\nConvert VSD:\n\n```bash\n# conversion\n$ vsd2svg-conv -i ./my.VSD -o ./out/ -s 7\n\n$ ls out/\nPage-1.svg  Page-2.svg  Page-3.svg  Page-4.svg\n\n# help\n$ vsd2svg-conv --help\n```\n\nLibrary\n=======\n\nConvert Visio Documents\n-----------------------\n\nexample:\n```cpp\n#include \u003cfstream\u003e\n#include \u003ciostream\u003e\n#include \u003cunordered_map\u003e\n#include \u003cvisio2svg/Visio2Svg.h\u003e\n\nint main(int argc, char **argv) {\n    // Put visio file in an std::string\n    // (no error checking, should be done in actual code)\n    std::ifstream stin(argv[1]);\n\n    std::string visio_in((std::istreambuf_iterator\u003cchar\u003e(stin)),\n                         std::istreambuf_iterator\u003cchar\u003e());\n\n    // Initialize converter and output map\n    visio2svg::Visio2Svg converter;\n    std::unordered_map\u003cstd::string, std::string\u003e out;\n\n    // return code\n    int ret = 0;\n\n    // Pick one of the following\n\n    // Convert vsd documents\n    ret = converter.vsd2svg(visio_in, out);\n\n    // Convert vss (Stencils) documents\n    ret = converter.vss2svg(visio_in, out);\n\n    // or with rescaling\n    ret = converter.vsd2svg(visio_in, out, 4.5);\n    ret = converter.vss2svg(visio_in, out, 4.5);\n\n    if (ret)\n        std::cerr \u003c\u003c \"Conversion errors occured\"\n                  \u003c\u003c \"\\n\";\n\n    // Do something with the output\n    for (const auto \u0026rule_pair : out) {\n        std::cout \u003c\u003c \"Sheet Title: \" \u003c\u003c rule_pair.first \u003c\u003c std::endl;\n        std::cout \u003c\u003c rule_pair.second \u003c\u003c std::endl;\n    }\n}\n```\n\nRecover symbol titles\n---------------------\n\nThis library also comes with a RVNG generator to recover symbol titles:\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003clibrevenge-generators/librevenge-generators.h\u003e\n#include \u003clibrevenge-stream/librevenge-stream.h\u003e\n#include \u003clibrevenge/librevenge.h\u003e\n#include \u003clibvisio/libvisio.h\u003e\n#include \u003cvisio2svg/TitleGenerator.h\u003e\n\nint main(int argc, char **argv) {\n    // put the Visio document in an RVNGFileStream \n    // (no error checking, should be done in actual code)\n    librevenge::RVNGFileStream input(argv[1]);\n\n    /* String stream version (need to be set)\n    librevenge::RVNGStringStream input;\n    */\n\n    // Recover Titles of each sheets\n    librevenge::RVNGStringVector output_names;\n    visio2svg::TitleGenerator generator_names(output_names);\n\n    bool ret = libvisio::VisioDocument::parseStencils(\u0026input, \u0026generator_names);\n    /* or this for vsd\n    ret = libvisio::VisioDocument::parse(\u0026input, \u0026generator_names);\n    */\n\n    if (!ret || output_names.empty()) {\n        std::cerr \u003c\u003c \"ERROR: Failed to recover sheets titles failed!\"\n                  \u003c\u003c std::endl;\n        return 1;\n    }\n\n    // do something with the names\n    for (unsigned k = 0; k \u003c output_names.size(); ++k) {\n        std::cout \u003c\u003c \"Title of stencil \" \u003c\u003c std::to_string(k) \u003c\u003c std::endl;\n        if (output_names[k].empty()) {\n            std::cout \u003c\u003c \"no title set in stencil number \" \u003c\u003c std::to_string(k)\n                      \u003c\u003c std::endl;\n        } else {\n            std::cout \u003c\u003c output_names[k].cstr() \u003c\u003c std::endl;\n        }\n    }\n}\n```\n\nChangelog\n=========\n\n0.5.5\n-----\n\n* add LIB_INSTALL_DIR variable in cmake\n\n0.5.4\n-----\n\n* fix freetype discovery in cmake\n\n0.5.3\n-----\n\n* fix segfault if shape doesn't contain title\n\n0.5.2\n-----\n\n* fix error in setting title field with titles containing \"\u0026\"\n* add XML_PARSE_HUGE in xml parsing to allow big image blobs.\n* better precision for image dimensions (keep 10 decimals)\n\n0.5.1\n-----\n\n* add support for OSX\n\n0.5.0\n-----\n\n* adding support to convert wmf blob (using libwmf)\n* requires new libraries as dependencies: libwmf and freetype)\n* requires libemf2svg version \u003e= 1.0.0\n* cleaner and more explicit dependencies resolving in cmake\n\n0.4.1\n-----\n\n* adding safeguard regarding unsafe output file paths\n\n0.3.0\n-----\n\n* better error handling\n\n0.2.0\n-----\n\n* add rescaling option + title\n\n0.1.0\n-----\n\n* first release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkakwa%2Flibvisio2svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkakwa%2Flibvisio2svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkakwa%2Flibvisio2svg/lists"}