Chromium launches failed while converting the HTML to PDF document in headless mode

60 views
Skip to first unread message

Karmegam Seerangan

unread,
Aug 7, 2025, 9:36:53 AMAug 7
to headless-dev
Hi All,

We are using Chromium's headless mode to convert HTML to PDF documents and images. When running the HTML to PDF conversion inside a Windows Docker container, Chromium fails to launch and crashes during initialization. As a result, the conversion process does not complete successfully in this environment.

Please take a look at the Docker file below.

# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS base
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["HTMLtoPDF_ASP_NET_Core_Windows_Docker/HTMLtoPDF_ASP_NET_Core_Windows_Docker.csproj", "HTMLtoPDF_ASP_NET_Core_Windows_Docker/"]
RUN dotnet restore "./HTMLtoPDF_ASP_NET_Core_Windows_Docker/HTMLtoPDF_ASP_NET_Core_Windows_Docker.csproj"
COPY . .
WORKDIR "/src/HTMLtoPDF_ASP_NET_Core_Windows_Docker"
RUN dotnet build "./HTMLtoPDF_ASP_NET_Core_Windows_Docker.csproj" -c %BUILD_CONFIGURATION% -o /app/build

# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./HTMLtoPDF_ASP_NET_Core_Windows_Docker.csproj" -c %BUILD_CONFIGURATION% -o /app/publish /p:UseAppHost=false

# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "HTMLtoPDF_ASP_NET_Core_Windows_Docker.dll"]


How to launch Chromium with headless mode in a Windows Docker container?

Regards,
Karmegam S

Karmegam Seerangan

unread,
Aug 22, 2025, 5:30:54 AMAug 22
to headless-dev, Karmegam Seerangan

Hi All,


Any updates on this?

Could someone assist with converting HTML to PDF inside a Windows Docker container using Chromium in headless mode?

Alternatively, is there another solution for converting HTML to PDF within a Windows Docker container?


Regards,

Karmegam S

 


Karmegam Seerangan

unread,
Sep 12, 2025, 8:56:00 AMSep 12
to headless-dev, Karmegam Seerangan
Hi Team,

Could you please let us know if there are any updates or if any additional information is required from our side to proceed?

We appreciate your support and look forward to your response.

Regards,
Karmegam

Andrey Kosyakov

unread,
Sep 12, 2025, 1:21:34 PMSep 12
to Karmegam Seerangan, headless-dev
Hello,

I'm sorry, we don't officially support docker, and it's not evident from the data you provided which flavor of headless fails and where. May I recommend asking on https://stackoverflow.com/?

Best regards,
Andrey.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/aa6cd7d8-b6d9-4b79-9a5e-e2584d2c512fn%40chromium.org.
Reply all
Reply to author
Forward
0 new messages