HakanL / WkHtmlToPdf-DotNet

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
GNU Lesser General Public License v3.0
367 stars 66 forks source link

NotSupportedException: Current platform is not supported #28

Closed ITaluone closed 2 years ago

ITaluone commented 3 years ago

Hi,

I've installed the NuGet package according to the documentation (README). But if I want to convert HTML to PDF this error shows up. Am I missing something here?

I'm running this on Windows 10 1909 x64, but in further process I want this to run inside an ASP.NET core 3.1 project on Ubuntu.

Thanks for any advice

Edit: Message: Current platform is not supported

Stacktrace: at WkHtmlToPdfDotNet.ModuleFactory.GetModule() at WkHtmlToPdfDotNet.PdfTools.Load() at WkHtmlToPdfDotNet.BasicConverter.Convert(IDocument document) at WkHtmlToPdfDotNet.SynchronizedConverter.<>c__DisplayClass5_0.b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()

HakanL commented 3 years ago

Are you getting this error in Windows, or Ubuntu? Are the examples in this project working?

ITaluone commented 3 years ago

The error occures on windows. If you mean this "Lorem Ipsum" examples.. Yes they are working..

Edit: But this is funny: if I do this inside the example project.. it works.. (there is IMHO nothing different with my solution..)

HtmlContent = File.ReadAllText("path\to\file.html")

HakanL commented 3 years ago

I'm not sure I understand what you mean, if you add File.ReadAllText to your project, or which project? What .NET platform is your project using? Can you share it?

ITaluone commented 3 years ago

Ok, I try to explain it: I have a .netstandard2.0 lib (inside of a .netcore3.1 webapi app) which loads a template .docx, searching template strings and replace them with real data. This is working as it should be (but not part of this project here). (On windows and Ubuntu)

Now I want to support some export possibilities like PDF or HTML. The PDF is generated (at this point) with libreoffice cli on ubuntu. In near future I want to get rid of this dependency and use a full ".net way" to convert to PDF.

I use DocumentFormat.OpenXML for the .docx and openXML-Power-Tools to convert to HTML. But here is the problem: I can load the HTML into this lib, but on this line "converter.Convert(doc);" the error happens.

I cannot tell more, because I have no more details, unfortunately..

PS: what I want to tell in the comment above: The HTML is definitly valid (and therefore the bug is not in the HTML)

And: I cannot share this project, because there are a bunch of internal dependencies and you would not be able to compile anyways.

HakanL commented 3 years ago

Ok, you probably need to create a simple project that runs in the same platform, etc as your main project and see if you can reproduce it. Windows 10 x64 is definitely supported, I use it myself in a project (ASP.Net Core 3.1 hosted in Azure)

amitHansda commented 3 years ago

Facing the same issue in Ubuntu 20.04. Do I need to install additional libraries or this nuget package is enough?

HakanL commented 3 years ago

Hmm, the NuGet package should be enough, but I've only tested this on Docker (where it works fine). Can you share more details about your project? Have you tried with a simple command line project? Which .NET version?

amitHansda commented 3 years ago

I gave it a trial run using a simple console application.

Project File

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Haukcode.WkHtmlToPdfDotNet" Version="1.3.0" />
  </ItemGroup>
</Project>

Program.cs

public class Program
    {
        public static void Main(string[] args)
        {
            var converter = new BasicConverter(new PdfTools());

            converter.PhaseChanged += Converter_PhaseChanged;
            converter.ProgressChanged += Converter_ProgressChanged;
            converter.Finished += Converter_Finished;
            converter.Warning += Converter_Warning;
            converter.Error += Converter_Error;

            var doc = new HtmlToPdfDocument()
            {
                GlobalSettings = {
                    ColorMode = ColorMode.Color,
                    Orientation = Orientation.Landscape,
                    PaperSize = PaperKind.A4,
                },
                Objects = {
                    new ObjectSettings() {
                        PagesCount = true,
                        HtmlContent = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur mauris eget ultrices iaculis. Ut et odio viverra, molestie lectus nec, venenatis turpis. Nulla quis euismod nisl. Duis scelerisque eros nec dui facilisis, sit amet porta odio varius. Praesent vitae sollicitudin leo. Sed vitae quam in massa eleifend porta. Aliquam pulvinar orci dapibus porta laoreet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed commodo tortor eget dolor hendrerit dapibus.
                                        Vivamus lorem diam, vulputate at ultrices quis, tristique eu nunc. Sed bibendum hendrerit leo. Nulla nec risus turpis. Vivamus at tortor felis. Donec eget posuere libero. Pellentesque erat nunc, molestie eget gravida vitae, eleifend a eros. Integer in tortor sed elit aliquam vehicula eget a erat. Vivamus nisi augue, venenatis ut commodo vel, congue id neque. Curabitur convallis dictum semper. Nulla accumsan urna aliquet, mattis dolor molestie, fermentum metus. Quisque at nisi non augue tempor commodo et pretium orci.
                                        Quisque blandit libero ut laoreet venenatis. Morbi sit amet quam varius, euismod dui et, volutpat felis. Sed nec ante vel est convallis placerat. Morbi mollis pretium tempor. Aliquam luctus eu justo vitae tristique. Sed in elit et elit sagittis pharetra sed vitae velit. Proin eget mi facilisis, scelerisque justo in, ornare urna. Aenean auctor ante ex, eget mattis neque pretium id. Aliquam ut risus leo. Vivamus ullamcorper et mauris in vehicula. Maecenas tristique interdum tempus. Etiam mattis lorem eget odio faucibus, in rhoncus nisi ultrices. Etiam at convallis nibh. Suspendisse tincidunt velit arcu, a volutpat nulla euismod sed.
                                        Aliquam mollis placerat blandit. Morbi in nibh urna. Donec nisl enim, tristique id tincidunt sed, pharetra non mi. Morbi viverra arcu vulputate risus dignissim efficitur. Vivamus dolor eros, finibus et porttitor a, pellentesque a lectus. Integer pellentesque maximus velit sit amet sollicitudin. Nulla a elit eget augue pretium luctus quis eu metus. Aenean nec dui id nibh tempor dapibus. Pellentesque dignissim ullamcorper mauris, vitae pharetra turpis sodales sit amet. Etiam et bibendum neque.
                                        Nulla gravida sit amet velit eu aliquet. Etiam sit amet elit leo. Sed nec arcu tincidunt, placerat turpis quis, laoreet nulla. Aenean neque est, fringilla non nulla in, laoreet vehicula nunc. Etiam vel nisl sit amet lectus pellentesque eleifend. Etiam sed nisi dolor. Mauris quis tincidunt ex. Aliquam porta mattis tempor. Maecenas fringilla bibendum elementum. Vestibulum quis tempus libero, vitae cursus neque. Suspendisse lectus risus, lacinia consectetur enim quis, ullamcorper porta tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
                        WebSettings = { DefaultEncoding = "utf-8" },
                        HeaderSettings = { FontSize = 9, Right = "Page [page] of [toPage]", Line = true },
                        FooterSettings = { FontSize = 9, Right = "Page [page] of [toPage]" }
                    }
                }
            };

            byte[] pdf = converter.Convert(doc);

            if (!Directory.Exists("Files"))
            {
                Directory.CreateDirectory("Files");
            }

            using (var stream = new FileStream(Path.Combine("Files", DateTime.UtcNow.Ticks.ToString() + ".pdf"), FileMode.Create))
            {
                stream.Write(pdf, 0, pdf.Length);
            }
        }

        private static void Converter_Error(object sender, WkHtmlToPdfDotNet.EventDefinitions.ErrorArgs e)
        {
            Console.WriteLine("[ERROR] {0}", e.Message);
        }

        private static void Converter_Warning(object sender, WkHtmlToPdfDotNet.EventDefinitions.WarningArgs e)
        {
            Console.WriteLine("[WARN] {0}", e.Message);
        }

        private static void Converter_Finished(object sender, WkHtmlToPdfDotNet.EventDefinitions.FinishedArgs e)
        {
            Console.WriteLine("Conversion {0} ", e.Success ? "successful" : "unsucessful");
        }

        private static void Converter_ProgressChanged(object sender, WkHtmlToPdfDotNet.EventDefinitions.ProgressChangedArgs e)
        {
            Console.WriteLine("Progress changed {0}", e.Description);
        }

        private static void Converter_PhaseChanged(object sender, WkHtmlToPdfDotNet.EventDefinitions.PhaseChangedArgs e)
        {
            Console.WriteLine("Phase changed {0} - {1}", e.CurrentPhase, e.Description);
        }
    }
HakanL commented 3 years ago

I created the above console app. Then I published it to a file folder (in Visual Studio on Windows 64). Then I ran it successfully under WSL2 in Ubuntu 18 and 20, both in 64-bit mode. I just added the default Ubuntu image from Microsoft Store, nothing else was installed in them.

yonahs commented 3 years ago

I am getting this error as well on Windows. Both local on Windows 10 and on Server Windows 2012.

HakanL commented 3 years ago

I am getting this error as well on Windows. Both local on Windows 10 and on Server Windows 2012.

I added the binaries for my test app here, see if you can run this (with .NET Core 3.1 runtime installed): https://github.com/HakanL/WkHtmlToPdf-DotNet/releases/tag/testapp

yonahs commented 3 years ago

@HakanL Your program worked (I think, I cant find where you saved the file, but looking at the screen, it seemed to be OK ) image

But how does that help me solve my problem on my server that is running on 4.7.2

Here is my very simple code:

    Dim doc As New HtmlToPdfDocument

    Dim g As New GlobalSettings
    g.ColorMode = ColorMode.Grayscale
    g.PaperSize = PaperKind.A4
    g.Orientation = Orientation.Portrait
    g.Out = "C:\Users\yoni\Downloads\RX_654321.pdf"

    doc.GlobalSettings = g
    doc.Objects.Add(New ObjectSettings With {.Page = "https://www.google.com"})

    Dim converter As New BasicConverter(New PdfTools)

    converter.Convert(doc)
HakanL commented 3 years ago

There should be a subfolder called Files that has the generated PDF. Ok, that's good. You never said you wanted to run this under FW 4.7.2, let me see if that works here, never tried that, I'm all .NET Core nowadays.

yonahs commented 3 years ago

Sorry. I had no subfolder files in the program folder.

Yes, I am trying to run this on a website running webforms..

Thanks

On Wed, Dec 9, 2020, 17:50 Hakan Lindestaf notifications@github.com wrote:

There should be a subfolder called Files that has the generated PDF. Ok, that's good. You never said you wanted to run this under FW 4.7.2, let me see if that works here, never tried that, I'm all .NET Core nowadays.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HakanL/WkHtmlToPdf-DotNet/issues/28#issuecomment-741861860, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7HRWN3MSYBBPSWQIRBPFTST6MFDANCNFSM4TZUA5OA .

HakanL commented 3 years ago

So it seems that when you add a .NET Standard NuGet package to .NET FW 4.7.2 then the runtimes files aren't included. I don't know how to fix that, may need some research, but you should be able to manually add the runtimes folder, see if that works.

yonahs commented 3 years ago

Pardon my inexperience, but which folders specifically should I be addin and where do I add them? (To my bin folder)

HakanL commented 3 years ago

All folders/files in the runtimes folder that you can copy from the .NET Core build (on another machine). But it's not a full solution, just for testing. Yes, into the same folder where your exe lives. Compare to the .NET Core build I sent you, the files have to be in the same place for .NET Framework, it's just that for some reason the build process for .NET Framework (4.7.2) doesn't add them automatically. That's the part that I need to look into how to fix.

josh-core commented 3 years ago

Hi, I'm also running into this problem, but running under docker with Linux as the target OS. If I run the project not under docker then it generates the pdf just fine. It's a very simple implementation and not much I can see I'm doing wrong.

This is the document.

return new HtmlToPdfDocument { GlobalSettings = { ColorMode = ColorMode.Color, Orientation = Orientation.Landscape, PaperSize = PaperKind.A4Plus }, Objects = { new ObjectSettings { PagesCount = true, HtmlContent = htmlString, WebSettings = { DefaultEncoding = "utf-8" }, HeaderSettings = { FontSize = 9, Right = "Page [page] of [toPage]", Line = true, Spacing = 2.812 } } } };

This is the service registration services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));

It's called from an async controller that returns a file.

This is the output: Exception thrown: 'System.DllNotFoundException' in WkHtmlToPdfDotNet.dll Exception thrown: 'System.DllNotFoundException' in WkHtmlToPdfDotNet.dll Exception thrown: 'System.DllNotFoundException' in WkHtmlToPdfDotNet.dll Exception thrown: 'System.NotSupportedException' in WkHtmlToPdfDotNet.dll Exception thrown: 'System.NotSupportedException' in System.Private.CoreLib.dll Exception thrown: 'System.AggregateException' in WkHtmlToPdfDotNet.dll

HakanL commented 3 years ago

@josh-core Can you try the docker example in the repo instead? Also verify that the native DLLs are in your docker image.

josh-core commented 3 years ago

Ahh, ok, so I did notice that the project TestConsoleAppDocker had the following within the docker file

# Install dependencies RUN apt-get update \ && apt-get install -y --no-install-recommends \ zlib1g \ libgdiplus \ libc6-dev \ ca-certificates \ fontconfig \ fontconfig-config \ fonts-dejavu-core \ libbsd0 \ libexpat1 \ libfontconfig1 \ libfontenc1 \ libfreetype6 \ libjpeg62-turbo \ libpng16-16 \ libssl1.1 \ libx11-6 \ libx11-data \ libxau6 \ libxcb1 \ libxdmcp6 \ libxext6 \ libxrender1 \ ucf \ x11-common \ xfonts-75dpi \ xfonts-base \ xfonts-encodings \ xfonts-utils \ && rm -rf /var/lib/apt/lists/*

Are these what's required for it to work? Yep, just added them and it works! Thanks.

HakanL commented 3 years ago

@josh-core Well, there are dependencies of the parent/native wkhtmltopdf, and the bare-bones docker images don't have those, so yes you need to make sure those dependencies are met. You can test it by running the wkhtmltopdf binaries in a container and see if that works, this .NET project is just a wrapper around the native wkhtmltopdf, so anything the native library requires is required.

BorisPetelj commented 3 years ago

Hi @HakanL, I believe I have a similar issue but with a different platform. I was using the library with no issues with .net core 2.2 on both Windows and Linux (18). After updating the entire project to .net 5.0, the error from the issue title occurs. Example app ("dotnet new web") with installed package ("dotnet add package Haukcode.WkHtmlToPdfDotNet.") and sample convert produces the error.

HakanL commented 3 years ago

@BorisPetelj I haven't tested this with .NET5, feel free to see if you can figure out what has changed.

BorisPetelj commented 3 years ago

I didn't have much time to commit to the Linux issue, but I can confirm that on Windows (7 and 10) it's working.

As far as Linux (Ubuntu 20.04), the "Current platform is not supported" occurs as the library cannot be located inside ModuleFactory.GetModule()

radupopabac commented 3 years ago

I'm getting the same error on ubuntu 18.04. I've installed the packages from the above but the issue is the same platform not supported in ModuleFactory.GetModule(). My machine is an azure machine if this helps, also I'm using it in conjunction with .netcore 3.1. I'm thinking that this project is using .netstandard 2.0 that may not be installed on my vm

HakanL commented 3 years ago

@radupopabac It's most likely missing libraries. Try to download the parent/native wkhtmltopdf project and see if that runs, this wrapper only calls the native library, if that library is missing something then there's nothing this C# wrapper can do, and you get the above error.

radupopabac commented 3 years ago

hi @HakanL after some digging I've found this article than following the steps I've installed the parent library manually. on install this yelled the following "The following packages have unmet dependencies: wkhtmltox : Depends: libpng12-0 but it is not installable" A bit into google I've found that "libpng12-0" is not supported since version 16.10, look here. After you get the package then install it as the guide says I was able to install the parent library to Linux 18.04 wohoo. I've run the test command wkhtmltopdf http://google.com google.pdf and a pdf was generated. In the code same error is generated. Things to mention:

HakanL commented 3 years ago

@radupopabac It looks like you've done a thorough job in trying to get it to work. Unfortunately I don't have a lot more details to give you, I have an Ubuntu 20.04 instance (WSL2) and I just installed .NET Core 3.1 and created a new console app (.NET Core 3.1) which I then built and executed on the Ubuntu instance. It generates the files just fine (there are no dependencies on anything in .NET Core 2). I also tested it successfully on Ubuntu 18.04 (also under WSL2). Both x64.

radupopabac commented 3 years ago

@HakanL how did you got the .so file? how did you build it to get it? Are you using 0.12.6 libraries or 0.12.5 it got me a bit confused as in commits I see .6 and on release the name is .5 :P

HakanL commented 3 years ago

@radupopabac I install the wkhtmltopdf binaries from their site using their installers. Then I grab the so file from the file system.

lic0914 commented 3 years ago

Hi , my project is runing on net core 3.1 in WSL2 I found the same exceptions ! The Errors

image

thanks

HakanL commented 3 years ago

@lic0914 Can you try to run the parent wkhtmltopdf project and see if that runs in your instance? The issue is most likely that Linux fails to load the SO due to missing dependencies, unfortunately those details don't bubble up to the C# code, all it gets is that the native library can't be loaded.

radupopabac commented 3 years ago

@HakanL I think I know what is the problem. You have a Linux on version 20.04 and my vm on azure was on 18.04 it seems that the .so files that you put inside the library are not compatible with the 18.04 version. Maybe not compatible with a different version of architecture if you run on arm64 they may not be compatible with amd64 and for sure with x86 architectures. As I can't use the library I've found this library which lets each developer to import it's own executable for windows, linux and mac. Hope this helps to solve this problem

HakanL commented 3 years ago

@radupopabac I've tested it in both 18 and 20, it worked fine here (granted WSL, but still). But maybe we need to figure out a way to have different binaries based on the distribution, hopefully it's not required. This project/wrapper does not currently support ARM64, so if you're testing on that then it won't work. The purpose of this library is so you don't have to manually add the binaries.

daniel-van-niekerk commented 3 years ago

Publishing to linux-x64 self-contained also doesn't copy over the runtimes folder. Manually copying the runtimes folder still produced the same error on Centos 7. Project is dotnetcore 3.1

I installed Wkhtmltopdf on that Centos 7 and called it directly from the command line to convert from html to a pdf and it worked fine. Just this nuget package that can't seem to find the linux-64 find the libwkhtmltox file.

HakanL commented 3 years ago

Publishing to linux-x64 self-contained also doesn't copy over the runtimes folder. Manually copying the runtimes folder still produced the same error on Centos 7. Project is dotnetcore 3.1

I installed Wkhtmltopdf on that Centos 7 and called it directly from the command line to convert from html to a pdf and it worked fine. Just this nuget package that can't seem to find the linux-64 find the libwkhtmltox file.

What steps do you take to publish to linux-x64 that doesn't copy the runtimes folder? When I build it in VS it puts the runtimes folder there with all the binaries. Can you share your project?

daniel-van-niekerk commented 3 years ago

What steps do you take to publish to linux-x64 that doesn't copy the runtimes folder? When I build it in VS it puts the runtimes folder there with all the binaries. Can you share your project?

Right-click the project -> Publish -> Folder -> netcoreapp3.1/linux-x64

The project config is:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Haukcode.WkHtmlToPdfDotNet" Version="1.3.0" />
  </ItemGroup>

  <ItemGroup>
    <None Update="templateOne.html">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

templateOne.html is just the file I read to to pass as the HtmlContent.

The only other code is:

string DATA = File.ReadAllText("templateOne.html");
var converter = new SynchronizedConverter(new PdfTools());

var doc = new HtmlToPdfDocument()
  {
      GlobalSettings = {
          ColorMode = ColorMode.Color,
          Orientation = Orientation.Portrait,
          PaperSize = PaperKind.A4,
      },
      Objects = {
          new ObjectSettings() {
              PagesCount = true,
              HtmlContent = DATA,
              WebSettings = { DefaultEncoding = "utf-8" }
          }
      }
  };

byte[] pdf = converter.Convert(doc);

Debugging this in Windows works fine.

HakanL commented 3 years ago

@daniel-van-niekerk So I tried to build my test project and just run it in Ubuntu 18.04, worked fine. But when I published I got the error when running it from the publish directory. I ran ldd libwkthmltopdf to see if there were any missing libraries and on my machine I was missing libjpeg62. Once I installed that I was able to run it successfully. I don't know/understand why I can run it fine in just the release folder (not publish), but not when published without this library. Maybe there's a difference in how things are loaded dynamically. But try ldd on the library and see if that gives you any insight.

sgoodgrove commented 3 years ago

I'm also getting this on Win 10 x64 .Net Core (3.1 I think).

If I clone your repo and try to run the unit tests I get the same error. If I update the DLL name (add ".dll") the unit tests (mostly) work.

ModuleFactory.cs from this

[DllImport(@"runtimes\win-x64\native\wkhtmltox", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl, EntryPoint = "wkhtmltopdf_version")]

to this

[DllImport(@"runtimes\win-x64\native\wkhtmltox.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl, EntryPoint = "wkhtmltopdf_version")]

FYI RepeatTableOfContents fails with this message (I added FluentAssertions).

    Expected pdf.Length to be greater than 20000, but found 13098.
AlphetaCS commented 3 years ago

@daniel-van-niekerk So I tried to build my test project and just run it in Ubuntu 18.04, worked fine. But when I published I got the error when running it from the publish directory. I ran ldd libwkthmltopdf to see if there were any missing libraries and on my machine I was missing libjpeg62. Once I installed that I was able to run it successfully. I don't know/understand why I can run it fine in just the release folder (not publish), but not when published without this library. Maybe there's a difference in how things are loaded dynamically. But try ldd on the library and see if that gives you any insight.

Installing libjpeg62 on Ubuntu 20.04 got this working for me. Thanks

nyash commented 3 years ago

Hi,

Debian 10 x64 on .NET 5 - would error out with Current platform is not supported

What fixed it for me:

a) Went to https://wkhtmltopdf.org/downloads.html and downloaded the .deb package for Debian x64 b) Installed it via: dpkg -i debpackagename.deb c) Typed: apt --fix-broken install to force dependency installation

Now the PDF generation works without changing anything on C# side.

Thanks.

HakanL commented 3 years ago

@nyash Thanks for the details. Yeah, the issue isn't necessarily that the platform isn't supported, it basically is that the native library can't be loaded, and in the .NET environment there are no further details to tell us if it's due to a missing dependency, or if the platform itself isn't supported. We could of course change the error message to include that, but does anybody has a suggestion for a better solution then I'm all open ears.

svnaidu commented 3 years ago

hi @HakanL , getting below error after deployment in docker. Im using .Net 5.

have added below line of code in docker file too. RUN apt-get update -qq && apt-get -y install libgdiplus libc6-dev

One or more errors occurred. (Unable to load native library. The platform may be missing native dependencies (libjpeg62, etc). Or the current platform is not supported.) Unable to load native library. The platform may be missing native dependencies (Ji libjpeg62, etc). Or the current platform is not supported.

HakanL commented 3 years ago

Most likely you're missing some dependencies that you have to install via your docker file. Try to add the libjpeg62 as suggested.

svnaidu41 commented 3 years ago

Hi @HakanL , how can I convert generated PDF into document? Is it possible to generate document with this?

HakanL commented 3 years ago

Hi @HakanL , how can I convert generated PDF into document? Is it possible to generate document with this?

@svnaidu41 This library is to convert from HTML to PDF. Also this question is not related to issue 28.

ognjenkurtic commented 3 years ago

Hi,

Debian 10 x64 on .NET 5 - would error out with Current platform is not supported

What fixed it for me:

a) Went to https://wkhtmltopdf.org/downloads.html and downloaded the .deb package for Debian x64 b) Installed it via: dpkg -i debpackagename.deb c) Typed: apt --fix-broken install to force dependency installation

Now the PDF generation works without changing anything on C# side.

Thanks.

Great stuff, thanks for this. Did the same on Ubuntu 16.04 by downloading the amd64 package and PDF generation now works.

WkHtmlToPdfDotNet version i am using is 1.5.8

HakanL commented 3 years ago

Most likely it's the jpeg library that was missing, installing the deb file will provide all the dependencies, something the .NET wrapper unfortunately can't.

adamsaffiullah commented 3 years ago

Install dependencies RUN apt-get update libgdiplus

HakanL commented 2 years ago

Closing this as the issue is most likely related to missing native libraries in the OS.