Comments (9)
@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.
@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.
@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.
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.
@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.
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.
@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.
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.
@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)
- wps文档加水印后,段落格式会被修改为段落后加10磅,导致页面都往下一页移动,格式错乱. HOT 9
- 文档横向页面加水印后页面变形,换页到下二页 HOT 2
- Word加水印提示 “Unknown color type encountered during WordML export - DrColor [EFFFFFFF].” HOT 1
- Trying to get in touch with you regarding a security issue HOT 3
- Cannot Run Live.Demo.UI with VS2019 16.11.2
- aspose.words是否支持.net5? HOT 4
- .NET Core / .net6 support HOT 1
- "error 0" after d&d of a doc HOT 1
- aspose_word15.8.0中docx文件加多水印后,表格中行高会变大,怎么处理 HOT 8
- 如何插入数学公式到文档当中? HOT 1
- ASPOSE.WORD for .net word to PDf erro Font '阿里巴巴普惠体 R' has not been found. Using 'Courier New' font instead. Reason: font info substitution. HOT 1
- please update your demo code to .net6.0 HOT 1
- an issues HOT 1
- 官方提供的实例程序中没有显示百分比 HOT 2
- hello,Aspose.Word中 builder.insertChart()方式怎么生成带折现的柱状图呢? HOT 2
- Convert text to PNG in C# for Unity HOT 1
- Docx to markdown conversion issues HOT 5
- Why the "Document Viewer Online" app is unavailable? In addition ,it doesn't have demo source code? HOT 1
- RuntimeError: Proxy error(ArgumentOutOfRangeException): Year, Month, and Day parameters describe an un-representable DateTime.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspose.words-for-.net.