Giter VIP home page Giter VIP logo

Comments (9)

AlexNosk avatar AlexNosk commented on May 22, 2024

@sunilshahi Aspose.Words for .NET Standard uses SkiaSharp to deal with graphics. To make it work on Linux, you should add reference either to SkiaSharp.NativeAssets.Linux or to SkiaSharp.NativeAssets.Linux.NoDependencies
If you add reference to SkiaSharp.NativeAssets.Linux, you should also install libfontconfig1 in your system. SkiaSharp.NativeAssets.Linux depends on this library. You can use the following command to install it:

apt-get update && apt-get install -y libfontconfig1

If you do not have rights to install packages, or other reasons not to install libfontconfig1, you can simply use SkiaSharp.NativeAssets.Linux.NoDependencies, which does not require installation of libfontconfig1.
Please let us know if you still face any issue while using Aspose.Words.

from aspose.words-for-.net.

sunilshahi avatar sunilshahi commented on May 22, 2024

@AlexNosk Thank you for your reply.
I tried installing SkiaSharp.NativeAssets.Linux.NoDependencies that worked as expected.

However, when I tested with SkiaSharp.NativeAssets.Linux and installing libfontconfig1 it did not work. I can use the no dependencies package and move on for now. Just wanted to let you know.

My Dockerfile if you are interested.

FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["TestAsposeImage/TestAsposeImage.csproj", "TestAsposeImage/"]
RUN dotnet restore "TestAsposeImage/TestAsposeImage.csproj"
COPY . .
WORKDIR "/src/TestAsposeImage"
RUN dotnet build "TestAsposeImage.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "TestAsposeImage.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
RUN apt-get update
RUN apt-get install -y libfontconfig1 
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TestAsposeImage.dll"]

Thank for help.

from aspose.words-for-.net.

AlexNosk avatar AlexNosk commented on May 22, 2024

@sunilshahi Which versions of Aspose.Words and SkiaSharp.NativeAssets.Linux do you use in your project? I will check and let you know how it goes on my side.

from aspose.words-for-.net.

sunilshahi avatar sunilshahi commented on May 22, 2024

Here are my nuget versions from csproj.

  <ItemGroup>
	  <PackageReference Include="Aspose.PDF" Version="21.7.0" />
	  <PackageReference Include="Aspose.Words" Version="21.7.0" />
	  <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
	  <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.3" />
  </ItemGroup>

Also this is the project that I was testing with if you are interested. Test Repo

from aspose.words-for-.net.

AlexNosk avatar AlexNosk commented on May 22, 2024

@sunilshahi Most likely the problem you have encountered is related to mono/SkiaSharp#1846. I would suggest you to use SkiaSharp 2.80.1, which is used in our internal tests and shows itself as quite stable.

from aspose.words-for-.net.

joshfria avatar joshfria commented on May 22, 2024

A year later and this single issue was the only thing to save me after 6+ hours of troubleshooting. Is the need for libfontconfig1 documented anywhere?

from aspose.words-for-.net.

AlexNosk avatar AlexNosk commented on May 22, 2024

@joshfria I believe this is described in SkiaSharp documentation, but I cannot find this right now. Also, this is described in Aspose.Words documentation here:
https://docs.aspose.com/words/net/how-to-run-aspose-words-in-docker/#configuring-a-dockerfile
Implicitly this is described in SkiaSharp.NativeAssets.Linux.NoDependencies package description:
https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies#readme-body-tab

from aspose.words-for-.net.

sebestyn168 avatar sebestyn168 commented on May 22, 2024

Migrating web app froim windows stack to linux stack also requires SkiaSharp.NativeAssets.Linux.NoDependencies
next step: embed used fonts in the document

from aspose.words-for-.net.

AlexNosk avatar AlexNosk commented on May 22, 2024

@sebestyn168 Yes, you are right. Aspose.Words for .NET Standard and .NET Core use SkiaSharp to deal with graphics, to make it work on Linux you have to add reference either to SkiaSharp.NativeAssets.Linux or to SkiaSharp.NativeAssets.Linux.NoDependencies

If you add reference to SkiaSharp.NativeAssets.Linux, you should also install libfontconfig1 in your system. SkiaSharp.NativeAssets.Linux depends on this library. You can use the following command to install it:

apt-get update && apt-get install -y libfontconfig1

If you do not have rights to install packages, or other reasons not to install libfontconfig1, you can simply use SkiaSharp.NativeAssets.Linux.NoDependencies, which does not require installation of libfontconfig1.

from aspose.words-for-.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.