Install-Package Bygdrift.PdfToDrawio -Version 0.1.1
dotnet add package Bygdrift.PdfToDrawio --version 0.1.1
<PackageReference Include="Bygdrift.PdfToDrawio" Version="0.1.1" />
paket add Bygdrift.PdfToDrawio --version 0.1.1
#r "nuget: Bygdrift.PdfToDrawio, 0.1.1"
// Install Bygdrift.PdfToDrawio as a Cake Addin #addin nuget:?package=Bygdrift.PdfToDrawio&version=0.1.1 // Install Bygdrift.PdfToDrawio as a Cake Tool #tool nuget:?package=Bygdrift.PdfToDrawio&version=0.1.1
With this project, you can convert a pdf or svg-file to a drawio-file. Drawio-files can be read with Diagrams.net, which is an excellent, free diagramming and vector graphics application, that can be used online, as a desktop-program and as a plugin to visual studio code.
This project uses a great project called pdftosvg to convert pdf to svg and then merges the svg into drawio in a layer called Background and locks the layer. It also creates a new layer so the file is ready to draw upon. Here is an example on a drawio file.
The reason for this project, was the need of making an extension to an FM system (facility management), that can be integrated on a homepage, so users can download drawing files of buildings, to a free drawing program, and easily make there own:
- Evacuation map like this
- "You are here" map like this
- Description of correction to be done like this
- interior design plan
How to use it
var drawIo = new Bygdrift.PdfToDrawio.Convert("SomeContent.pdf"); //or svg drawIo.ToDrawIo("someContent.drawio"); var stream = drawIo.ToDrawIo();
var drawIo = new Bygdrift.PdfToDrawio.Convert("SomeContent.pdf"); //or svg drawIo.ToMxGraphModel("someContent.xml"); var stream = drawIo.ToMxGraphModel();
The imported pdf can consist of multiple pages.
This project can be tested by downloading it and run the unit test
Inspiration on how to use the project
Personally, I will build a function app to Azure, as an http-trigger, that consist of a simple front end html, that can be integrated on an organisations intranet, so people can search and find a pdf from a FM-system. Then they can choose, either to download the pdf or a drawio-file.
It should be possible to add headers and footers to each page, and I will be working on a better help to users that doesn't know drawio. So if they are making an evacuation map, they can read in a "Howto get started"-shape on the fist page and some help to find a shape library for evacuation maps from their own organization.
|.NET||net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows|
- PdfToSvg.NET (>= 0.7.0)
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.