Bygdrift.PdfToDrawio 0.1.1

.NET 5.0
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" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bygdrift.PdfToDrawio --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bygdrift.PdfToDrawio, 0.1.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PdfToDrawio

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:

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 PdfToDrawioTests.ConvertTests.ConvertPdf().

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.

Whats next

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.

Product Versions
.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
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.1 229 10/24/2021