Has anyone seen this error when converting an EML file to PDF:
ReadIndexedMemoryBitmap: unsupported format #3
HRESULT -2147467263
at External.Pdf.Advanced.PdfImage.ReadIndexedMemoryBitmap( bitmap, Int32 bits)
at External.Pdf.Advanced.PdfImage.InitializeNonJpeg( bitmap)
at External.Pdf.Advanced.PdfImage…ctor( document, bitmap)
at External.Pdf.Advanced.PdfImageTable.GetImage( bitmap)
at External.Pdf.Advanced.ContentStreamExtensions.GetImageName(IContentStream this, bitmap)
at .( )
at . ( , )
at . ( , , )
at .( , , )
at .( , , )
at .( )
at . ( )
at .( )
at .( )
at . ()
at .( , , [] )
at .( , , Int32 )
at . (Int32 , Object , Object )
at GemBox.Document.DocumentModelPaginator.dca75czcds9lmgv2y95q5srjljs9plta (Int32 , Object , Object )
at . ( , String , Stream )
at .( , , Stream )
at GemBox.Document.PdfSaveOptions.67tg5rkvl9zwp8v7723mndgzuc3b4vj8 ( , Stream , Boolean )
at GemBox.Document.PdfSaveOptions.67tg5rkvl9zwp8v7723mndgzuc3b4vj8 (DocumentModel , Stream , String )
at GemBox.Document.DocumentModel.Save(String path, SaveOptions options)
at GemBox.Document.DocumentModel.Save(String path)
at TestGembox.Program.Main(String[] args) in C:\Users\thayes\source\repos\TestGembox\TestGembox\Program.cs:line 47
I have narrowed it down to an EML with an XLSX attachment that contains a logo image. We only see this when running in a Docker container running Linux, it runs fine when we run in Windows. I can replicate this with a client’s email however I have been unable to replicate it with an anonymized version of the email.
Dockerfile
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
WORKDIR /app
RUN sed -i’.bak’ ‘s/$/ contrib/’ /etc/apt/sources.list
RUN apt-get update; apt-get install -y libgdiplus ttf-mscorefonts-installer fontconfig fonts-liberation
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY [“TestGembox.csproj”, “”]
COPY [“ReadIndexedMemoryBitmapError.eml”, “”]
RUN dotnet restore “./TestGembox.csproj”
COPY . .
WORKDIR “/src/.”
RUN dotnet build “TestGembox.csproj” -c Release -o /app/build
FROM build AS publish
RUN dotnet publish “TestGembox.csproj” -c Release -o /app/publish
FROM base AS final
Update package sources to include supplemental packages (contrib archive area).
RUN sed -i ‘s/main/main contrib/g’ /etc/apt/sources.list
Downloads the package lists from the repositories.
RUN apt-get update
Install System.Drawing.Common dependency.
RUN apt-get install -y libgdiplus
Install Microsoft TrueType core fonts.
RUN apt-get install -y ttf-mscorefonts-installer
RUN apt-get install -y fontconfig
RUN apt-get install -y fonts-liberation
Or install Liberation TrueType fonts.
RUN apt-get install -y fonts-liberation
Or some other font package…
WORKDIR /app
COPY --from=publish /app/publish .
RUN pwd
ENTRYPOINT [“dotnet”, “TestGembox.dll”]
Tim H