Search Unity

Question How to use dll files properly in Unity?

Discussion in 'Scripting' started by STANLY1997, Apr 17, 2021.

  1. STANLY1997

    STANLY1997

    Joined:
    Oct 24, 2020
    Posts:
    4
    I wrote a program that puts a QR-Code on a PDF page in Visual Studio. Now i want it to be part of a Unity project and i am having trouble with implementing it.

    Used in the project:

    Code (CSharp):
    1. using System.Drawing;
    2. using PdfSharp.Drawing;
    3. using PdfSharp.Pdf;
    4. using System.IO;
    Here is the problem:
    Code (CSharp):
    1.  
    2. XFont font = new XFont(tkFont, fontSize, XFontStyle.Regular);
    3.  
    new XFont gets underlined red. It is part of PdfSharp.Drawing; but once i try to use it in Unity, VisualStudio tells me that: The type 'FontFamily' allegedly has been declared in System.Drawing but could not been found, even when it 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
     
  2. STANLY1997

    STANLY1997

    Joined:
    Oct 24, 2020
    Posts:
    4