QuestPDF icon indicating copy to clipboard operation
QuestPDF copied to clipboard

Cannot create the PDF document using the SkiaSharp-related library

Open mukeshanand123 opened this issue 3 years ago • 4 comments

We are using Quest pdf for generate pdf and working fine in local directory. but when deploy in GKE there is some dependency issue . Note:- I have installed all dependecy packages like linux, mac, dependecy , but getting same error in google cloud. Cannot create the PDF document using the SkiaSharp-related library. This exception usually means that, on your operating system where you run the application, SkiaSharp-related requires installing additional dependencies. Such dependencies are available as additional nuget packages, for example *.NativeAssets.Linux.NoDependencies. Some operating systems may require installing multiple nugets, e.g. MacOS may need both *.NativeAssets.macOS.NoDependencies and *.NativeAssets.Linux.NoDependencies.Please refer to the SkiaSharp-related documentation for more details. Also, please consult the inner exception that has been originally thrown by the dependency library.", "StatusCode": 500

please find below details. OS Name: debian OS Version: 11 OS Platform: Linux

Thanks in Advance Mukesh

mukeshanand123 avatar Sep 05 '22 15:09 mukeshanand123

please provide any suggestion asap, in local its working properly but when deployed to GKE its getting skia sharp related issue.

mukeshanand123 avatar Sep 05 '22 16:09 mukeshanand123

If you follow the detailed error message and install the necessary NuGet packages, it should work. I was facing the same problem and solved it by adding the following packages:

<ItemGroup>
      <PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2.2" />
      <PackageReference Include="HarfBuzzSharp.NativeAssets.macOS" Version="2.8.2.2" />
      <PackageReference Include="QuestPDF" Version="2022.9.0" />
      <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.2" />
      <PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="2.88.2" />
</ItemGroup>

I am running macOS on Apple Silicon, so you should be able to find the right dependencies by trial and error for Debian.

CollinAlpert avatar Oct 03 '22 23:10 CollinAlpert

If you follow the detailed error message and install the necessary NuGet packages, it should work. I was facing the same problem and solved it by adding the following packages:

<ItemGroup>
      <PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2.2" />
      <PackageReference Include="HarfBuzzSharp.NativeAssets.macOS" Version="2.8.2.2" />
      <PackageReference Include="QuestPDF" Version="2022.9.0" />
      <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.2" />
      <PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="2.88.2" />
</ItemGroup>

I am running macOS on Apple Silicon, so you should be able to find the right dependencies by trial and error for Debian.

Did the trick for me on M2P! Thank you!! 🍻

dMeshko avatar Feb 09 '23 18:02 dMeshko

If you follow the detailed error message and install the necessary NuGet packages, it should work. I was facing the same problem and solved it by adding the following packages:

<ItemGroup>
      <PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2.2" />
      <PackageReference Include="HarfBuzzSharp.NativeAssets.macOS" Version="2.8.2.2" />
      <PackageReference Include="QuestPDF" Version="2022.9.0" />
      <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.2" />
      <PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="2.88.2" />
</ItemGroup>

I am running macOS on Apple Silicon, so you should be able to find the right dependencies by trial and error for Debian.

I've had the same issue on an Intel Mac, thank you!

Shouldn't the package pull in the dpeendencies if required? Any updates?

ilserd avatar Aug 24 '23 09:08 ilserd