When I use the following code:
- Code: Select all
string htmlString = "<html><body><h1>Hello, World!</h1></body></html>";
string pluginPath = "/home/[UserName]/source/prototypes/dotnet/plugins/plugins";
string fileName = "HelloWorld.pdf";
var pdfStream = new MemoryStream();
HtmlConverter.PluginPath = pluginPath;
HtmlConverter.Convert(htmlString, fileName, true, 100000, new Size(1080, 1000), new PdfMargins(0), Spire.Pdf.HtmlConverter.LoadHtmlType.SourceCode);
// Convert HTML to PDF
// HtmlConverter.Convert(htmlString, pdfStream, LoadHtmlType.SourceCode);
// string filePath = "output.pdf";
// File.WriteAllBytes(filePath, pdfStream.ToArray());
Console.WriteLine("PDF file created successfully.");
I get errors about being unable to load the shared library libdl.
HTMLConverter: System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
What am I doing wrong here? I am running this on ubuntu, with the intention of deploying a similar solution to a linux container in Azure.