I made a test application in .NET Core and it works in Windows, but when I publish to Linux I got this error on GdPicture registration:
Code: Select all
Unable to load shared library 'kernel32' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libkernel32: cannot open shared object file: No such file or directory - at ᤫ.LoadLibrary(String A_0)
at ᥥ.ᜀ(Boolean A_0, Boolean A_1)
at ᡌ.ᜀ(Boolean A_0, Int32 A_1, Boolean A_2)
at GdPicture14.LicenseManager..ctor()
at GdPictureThumbnailCore.Program.RegistraGdPicture() in C:\Users\jean.heidemann\source\repos\GdPictureThumbnailCore\GdPictureThumbnailCore\Program.cs:line 4
I just register GdPicture, load a PDF and create a Thumbnail of it.
This is my full source code
Code: Select all
using GdPicture14;
using System;
using System.Drawing;
using System.IO;
namespace GdPictureThumbnailCore
{
class Program
{
static void Main(string[] args)
{
try
{
Console.WriteLine("DEBUG 1");
RegistraGdPicture();
Console.WriteLine("DEBUG 2");
using (GdPicturePDF gdPdf = new GdPicturePDF())
{
Console.WriteLine("Enter the PDF path");
String pdfPath = Console.ReadLine();
gdPdf.LoadFromFile(pdfPath, false);
Console.WriteLine("DEBUG 4");
int thumbId = gdPdf.CreateThumbnailHQ(300, 200, Color.Transparent);
gdPdf.CloseDocument();
using (GdPictureImaging img = new GdPictureImaging())
{
Console.WriteLine("Enter the Thumbnail path (JPG)");
String thumbPath = Console.ReadLine();
img.SaveAsJPEG(thumbId, thumbPath);
Console.WriteLine("DEBUG 6");
img.ReleaseGdPictureImage(thumbId);
}
}
} catch (Exception e)
{
Console.WriteLine(e.Message + " - " + e.StackTrace);
}
Console.WriteLine("THE END");
Console.ReadKey();
}
private static void RegistraGdPicture()
{
var key = "MY KEY HERE";
new LicenseManager().RegisterKEY(key);
}
}
}