- Home /
How to use dll files properly in Unity?
I wrote a program that puts an QR-Code on a PDF page. Now i want it to be part of a Unity project and i am having trouble with implementing it.
Used in the project:
using System.Drawing;
using PdfSharp.Drawing;
using PdfSharp.Pdf;
using System.IO;
Here is the problem:
XFont font = new XFont(tkFont, fontSize, XFontStyle.Regular);
new XFont
gets underlined red. It is part of PdfSharp.Drawing;
but once i try to use it in Unity, Visual Studio tells me that: "The type 'FontFamily'
allegedly has been declared in System.Drawing
but could not been found", even thoit originates from PdfSharp.Drawing
.
I already tried to set Unity .NET from Version 2.0 to 4.x and i also tried different packages in terms of version numbers.
It is the first time that i try to implement external dll files into unity, so maybe the problem could be something related to that.
Also other things that originate from PdfSharp.Drawing
like XGraphics
seem to work properly
All in all, Visual Studio is able to run it, Unity is not able to do so even tho i imported all necessary dll files.
I hope somebody can help me with this. Thanks in advance for every bit of hints you can give me.
even tho i imported all necessary dll files.
That's where you should get a lot more concrete what you did ^^. What files did you put where exactly?
I downloaded the dll files that VisualStudio needed to run the program, which are: MessagingToolkit.QRCode.1.3.0 Zen.Barcode.Rendering.Framework.3.1.10729.1 PdfSharp.1.50.5147 System.Text.Encoding.CodePages and also System.Drawing.Common which is located under Assets/Plugins/net20 the weird thing is that System.Drawing does not contain "FontFamily" when used in Unity.