Search Unity

Externe DLL and class instance

Discussion in 'Scripting' started by joschy3d, May 30, 2011.

  1. joschy3d

    joschy3d

    Joined:
    Jun 2, 2010
    Posts:
    23
    Hello,
    we try to get the function of the PDF Renderer SDK into unity.
    http://bytescout.com/products/developer/pdfrenderersdk/index.html

    From the sample code of the SDK:
    Code (csharp):
    1. static void Main(string[] args)
    2.         {
    3.             // Create an instance of Bytescout.PDFRenderer.RasterRenderer object and register it.
    4.             RasterRenderer renderer = new RasterRenderer();
    5.             renderer.RegistrationName = "demo";
    6.             renderer.RegistrationKey = "demo";
    7.  
    8.             // Load PDF document.
    9.             renderer.LoadDocumentFromFile("multipage.pdf");
    10.  
    11.             // Render first page of the document to PNG image file.
    12.             renderer.RenderPageToFile(0, RasterOutputFormat.PNG, "result.png");
    13.  
    14.             // Open the output file in default image viewer.
    15.             System.Diagnostics.Process.Start("result.png");
    16.         }
    17.  
    I know how to get access of functions within a external *.dll, but how can I make instance of Bytescout.PDFRenderer.RasterRenderer object?

    That is the class description:
    Code (csharp):
    1. [ClassInterfaceAttribute(ClassInterfaceType.AutoDual)]
    2. public class RasterRenderer : BaseRenderer,
    3.     IRasterRenderer, IBaseRenderer, IDisposable
    4.  
    I'm not a C# crack, so some syntax help would be nice :) Or is it not possible?

    tia, joschy
     
  2. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Not sure of your problem exactly, but are you including the necessary namespace at the top of your Unity script? Like

    using Bytescout.PDFRenderer;
     
  3. joschy3d

    joschy3d

    Joined:
    Jun 2, 2010
    Posts:
    23
    Yes, I´ve done it. May be it is not unitys problem. I have wrote a email to the sdk guys...

    thanks for your replay,