Documentation

Docker Setup

Install DGtalSharp.Pdf nuget package

Install-Package DGtalSharp.Pdf

Install native packages. For linux docker install following package

Install-Package DGtalSharp.Pdf.Linux

Automatic Dependency Installation

By default DGtalSharp.Pdf automatically detects and installs all dependencies. To speedup application startup, this can be skipped using

DGtalSharp.Pdf.PdfInitializer.Initialize(skipPrerequisites: true);


Docker File

Add following command in docker file to install pre-requisites

RUN apt update \
    && apt install -y sudo libxkbcommon-x11-0 libc6 libc6-dev libgtk2.0-0 libnss3 libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common libgbm1 libasound2 libxrender1 libfontconfig1 libxshmfence1 libgdiplus libva-dev libappindicator3-1

Here is the sample docker file for official .net 6 based docker image

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

RUN apt update \
    && apt install -y sudo libxkbcommon-x11-0 libc6 libc6-dev libgtk2.0-0 libnss3 libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common libgbm1 libasound2 libxrender1 libfontconfig1 libxshmfence1 libgdiplus libva-dev libappindicator3-1


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

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

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "SampleWeb.dll"]