Skip to content

Commit a7a605f

Browse files
author
Ethan Bishop
committed
Update base image to .net 8/Ubuntu Noble
This allows pdf2htmlEX to target and use newer `libcairo`, which fixes graphical images with some PDF features.
1 parent f7d77d6 commit a7a605f

9 files changed

Lines changed: 58 additions & 10 deletions

File tree

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up dotnet
3636
uses: actions/setup-dotnet@v3
3737
with:
38-
dotnet-version: "7.x"
38+
dotnet-version: "8.x"
3939
- name: E2E tests
4040
run: |
4141
docker run --rm --detach -p 8080:8080 --name pdf2html ${{ env.TEST_TAG }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## develop
44

5+
* Update to .net 8.
6+
* Switch base images to Ubuntu Noble (24.04 LTS).
57
* Increase `font-size-multiplier` to increase text rendering fidelity and get rid of sporadic empty spaces at the end of numbers.
68
* Patch and build `pdf2htmlEX` as part of this build process to use `libopenjp` instead of `libjpeg` for JPEG-2000 support.
79
* All patches are in this source tree, and are applied to directly to the source of the upstream tag during build.

src/Pdf2Html/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1
2-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-pdf2htmlex
2+
FROM ubuntu:noble AS build-pdf2htmlex
33

44
# Produces a patched pdf2htmlEX using libopenjp 2.7 instead of libjpeg to get JPEG2000 support.
55

@@ -26,6 +26,8 @@ RUN ./buildScripts/reportEnvs
2626
RUN ./buildScripts/getBuildToolsApt
2727
RUN ./buildScripts/getDevLibrariesApt
2828
RUN ./buildScripts/getPoppler
29+
RUN patch ./poppler/glib/poppler-enums.c.template ./patches/poppler-enums.c.template.patch
30+
RUN patch ./poppler/glib/poppler-private.h ./patches/poppler-private.h.patch
2931
RUN ./buildScripts/buildPoppler
3032
RUN ./buildScripts/getFontforge
3133
RUN ./buildScripts/buildFontforge
@@ -35,12 +37,12 @@ RUN git config user.name "CoreFiling"
3537
RUN git config user.email "opensource@corefiling.com"
3638
RUN ./buildScripts/createDebianPackage
3739

38-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
40+
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
3941
WORKDIR /source
4042
COPY ./ .
4143
RUN dotnet publish -c release -o /app
4244

43-
FROM mcr.microsoft.com/dotnet/aspnet:7.0
45+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble
4446
RUN apt update && apt install -y wget
4547
RUN wget http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
4648
RUN apt install -y ./libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb

src/Pdf2Html/Pdf2Html.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Version>1.0.0</Version>
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
1414
</ItemGroup>
1515

1616
</Project>

src/Pdf2Html/pdf2htmlEX/patches/CMakeLists.patch

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
@@ -97,6 +97,7 @@
1+
@@ -23,6 +23,10 @@ add_custom_target(dist
2+
3+
find_package(PkgConfig)
4+
5+
+include_directories(
6+
+ /usr/include/glib-2.0
7+
+ /usr/lib/x86_64-linux-gnu/glib-2.0/include
8+
+)
9+
10+
# SINCE we have a very intimate relationship with a particular version of
11+
# poppler... we explicitly describe the poppler include and library
12+
@@ -97,6 +101,7 @@ set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS}
213
${LIB_INTL_LIBRARIES}
314
${CAIRO_LIBRARIES}
415
-ljpeg
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@@ -17,7 +17,7 @@ GType
2+
{
3+
static volatile gsize g_define_type_id__volatile = 0;
4+
5+
- if (g_once_init_enter (&g_define_type_id__volatile)) {
6+
+ if (g_once_init_enter ((gsize*) &g_define_type_id__volatile)) {
7+
static const G@Type@Value values[] = {
8+
/*** END value-header ***/
9+
10+
@@ -31,7 +31,7 @@ GType
11+
GType g_define_type_id =
12+
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
13+
14+
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
15+
+ g_once_init_leave ((gsize*) &g_define_type_id__volatile, g_define_type_id);
16+
}
17+
18+
return g_define_type_id__volatile;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@@ -155,12 +155,12 @@ GType
2+
type_name##_get_type (void) \
3+
{ \
4+
static volatile gsize g_define_type_id__volatile = 0; \
5+
- if (g_once_init_enter (&g_define_type_id__volatile)) { \
6+
+ if (g_once_init_enter ((gsize*) &g_define_type_id__volatile)) { \
7+
GType g_define_type_id = \
8+
g_boxed_type_register_static (g_intern_static_string (#TypeName), \
9+
(GBoxedCopyFunc) copy_func, \
10+
(GBoxedFreeFunc) free_func); \
11+
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
12+
+ g_once_init_leave ((gsize*) &g_define_type_id__volatile, g_define_type_id); \
13+
} \
14+
return g_define_type_id__volatile; \
15+
}

tests/E2E.Tests/E2E.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:7477ce992c3a62ff37d722cb34e9b3e7e896ad4e4239830834f2bb2525231eba
3-
size 1318376
2+
oid sha256:d148ce875ec6d3d3f7cbacc314d32e8d5818fb69a0f6dc7d5ce8cbf2f9bb9ba2
3+
size 1216351

0 commit comments

Comments
 (0)