-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
373 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
sources: | ||
"0.18.8.rc1-20240905-git": | ||
url: "https://github.com/ViliusSutkus89/pdf2htmlEX/archive/0bbd6686f7214c5ddb230fa3323b75e954f39418.zip" | ||
sha256: "394a5a5555005a18ada6f810ef7ab693f6d916cd9302d874483cbc4956caf557" | ||
"0.18.8.rc1-git-6f85c88": | ||
url: "https://github.com/opendocument-app/pdf2htmlEX/archive/refs/tags/v0.18.8.rc1-git-6f85c88.tar.gz" | ||
sha256: "cc19848576f84469d290e6e271e07dd17ffcc15f40357b8d7456e4f6d1b3ebcf" | ||
patches: | ||
"0.18.8.rc1-git-6f85c88": | ||
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0001-Upgrade-Poppler-to-24.06.1.patch" | ||
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0002-CI-Use-Ubuntu-22.04-upgrade-actions-checkout-and-act.patch" | ||
- patch_file: "0003-Update-missing-font-workaround.patch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
recipes/pdf2htmlex/all/patches/0.18.8.rc1-git-6f85c88/0001-Upgrade-Poppler-to-24.06.1.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
From 5e5a947bd1320e19c1271f5dfaeef098baae4452 Mon Sep 17 00:00:00 2001 | ||
From: Vilius Sutkus '89 <[email protected]> | ||
Date: Thu, 13 Jun 2024 14:18:06 +0300 | ||
Subject: [PATCH 1/3] Upgrade Poppler to 24.06.1 | ||
|
||
Poppler-24.02.0 OutlineItem changed Title from Unicode pointer and length counter into Unicode vector. ( https://gitlab.freedesktop.org/poppler/poppler/-/commit/fc1c711cb5f769546c6b31cc688bf0ee7f0c1dbc ) | ||
|
||
Poppler-24.03.0 GooString.h exposes std::string::starts_with and ::ends_with which are CXX20. | ||
--- | ||
buildScripts/versionEnvs | 5 ++- | ||
pdf2htmlEX/CMakeLists.txt | 4 +- | ||
pdf2htmlEX/src/HTMLRenderer/outline.cc | 2 +- | ||
pdf2htmlEX/src/util/encoding.cc | 60 +++++++++++++++----------- | ||
pdf2htmlEX/src/util/encoding.h | 2 + | ||
5 files changed, 44 insertions(+), 29 deletions(-) | ||
|
||
diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs | ||
index 3ea6cba..9ef5f8b 100755 | ||
--- a/buildScripts/versionEnvs | ||
+++ b/buildScripts/versionEnvs | ||
@@ -4,11 +4,12 @@ | ||
# versions | ||
|
||
# see: https://poppler.freedesktop.org/releases.html | ||
-# current working: 24.01.0 | ||
+# current working: 24.06.1 | ||
|
||
export PDF2HTMLEX_VERSION=0.18.8.rc2 | ||
|
||
-export POPPLER_VERSION=poppler-24.01.0 | ||
+export POPPLER_VERSION=poppler-24.06.1 | ||
+#export POPPLER_VERSION=poppler-24.01.0 | ||
#export POPPLER_VERSION=poppler-23.12.0 | ||
#export POPPLER_VERSION=poppler-21.02.0 | ||
#export POPPLER_VERSION=poppler-0.89.0 | ||
diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt | ||
index 761bb21..84b4a98 100644 | ||
--- a/pdf2htmlEX/CMakeLists.txt | ||
+++ b/pdf2htmlEX/CMakeLists.txt | ||
@@ -125,8 +125,8 @@ set(CMAKE_THREAD_PREFER_PTHREAD ON) | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} Threads::Threads) | ||
-# Poppler-23.12.0 requires CXX17 | ||
-set(CMAKE_CXX_STANDARD 17) | ||
+# Poppler-24.03.0 requires CXX20 | ||
+set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
if(NOT CYGWIN) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
diff --git a/pdf2htmlEX/src/HTMLRenderer/outline.cc b/pdf2htmlEX/src/HTMLRenderer/outline.cc | ||
index 4fdc826..28415c8 100644 | ||
--- a/pdf2htmlEX/src/HTMLRenderer/outline.cc | ||
+++ b/pdf2htmlEX/src/HTMLRenderer/outline.cc | ||
@@ -42,7 +42,7 @@ void HTMLRenderer::process_outline_items(const std::vector<OutlineItem*> * items | ||
|
||
f_outline.fs << ">"; | ||
|
||
- writeUnicodes(f_outline.fs, item->getTitle(), item->getTitleLength()); | ||
+ writeUnicodes(f_outline.fs, item->getTitle()); | ||
|
||
f_outline.fs << "</a>"; | ||
|
||
diff --git a/pdf2htmlEX/src/util/encoding.cc b/pdf2htmlEX/src/util/encoding.cc | ||
index 6b600bc..1e3fc29 100644 | ||
--- a/pdf2htmlEX/src/util/encoding.cc | ||
+++ b/pdf2htmlEX/src/util/encoding.cc | ||
@@ -55,34 +55,46 @@ static int mapUTF8(Unicode u, char *buf, int bufSize) | ||
} | ||
} | ||
|
||
+static void writeUnicode(ostream & out, const Unicode u) { | ||
+ switch(u) | ||
+ { | ||
+ case '&': | ||
+ out << "&"; | ||
+ break; | ||
+ case '\"': | ||
+ out << """; | ||
+ break; | ||
+ case '\'': | ||
+ out << "'"; | ||
+ break; | ||
+ case '<': | ||
+ out << "<"; | ||
+ break; | ||
+ case '>': | ||
+ out << ">"; | ||
+ break; | ||
+ default: | ||
+ { | ||
+ char buf[4]; | ||
+ auto n = mapUTF8(u, buf, 4); | ||
+ out.write(buf, n); | ||
+ } | ||
+ } | ||
+} | ||
+ | ||
void writeUnicodes(ostream & out, const Unicode * u, int uLen) | ||
{ | ||
for(int i = 0; i < uLen; ++i) | ||
{ | ||
- switch(u[i]) | ||
- { | ||
- case '&': | ||
- out << "&"; | ||
- break; | ||
- case '\"': | ||
- out << """; | ||
- break; | ||
- case '\'': | ||
- out << "'"; | ||
- break; | ||
- case '<': | ||
- out << "<"; | ||
- break; | ||
- case '>': | ||
- out << ">"; | ||
- break; | ||
- default: | ||
- { | ||
- char buf[4]; | ||
- auto n = mapUTF8(u[i], buf, 4); | ||
- out.write(buf, n); | ||
- } | ||
- } | ||
+ writeUnicode(out, u[i]); | ||
+ } | ||
+} | ||
+ | ||
+void writeUnicodes(ostream & out, const std::vector<Unicode> & u) | ||
+{ | ||
+ for(const auto & i: u) | ||
+ { | ||
+ writeUnicode(out, i); | ||
} | ||
} | ||
|
||
diff --git a/pdf2htmlEX/src/util/encoding.h b/pdf2htmlEX/src/util/encoding.h | ||
index c4d7732..da3c00f 100644 | ||
--- a/pdf2htmlEX/src/util/encoding.h | ||
+++ b/pdf2htmlEX/src/util/encoding.h | ||
@@ -9,6 +9,7 @@ | ||
#define ENCODING_H__ | ||
|
||
#include <string> | ||
+#include <vector> | ||
#include <iostream> | ||
|
||
#include <CharTypes.h> | ||
@@ -19,6 +20,7 @@ namespace pdf2htmlEX { | ||
* Escape necessary characters, and map Unicode to UTF-8 | ||
*/ | ||
void writeUnicodes(std::ostream & out, const Unicode * u, int uLen); | ||
+void writeUnicodes(std::ostream & out, const std::vector<Unicode> & u); | ||
|
||
|
||
/* | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
38 changes: 38 additions & 0 deletions
38
...es/0.18.8.rc1-git-6f85c88/0002-CI-Use-Ubuntu-22.04-upgrade-actions-checkout-and-act.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From b66edbc20b4063d45aaa75191be536c27d137584 Mon Sep 17 00:00:00 2001 | ||
From: Vilius Sutkus '89 <[email protected]> | ||
Date: Thu, 13 Jun 2024 14:19:32 +0300 | ||
Subject: [PATCH 2/3] [CI] Use Ubuntu 22.04, upgrade actions/checkout and | ||
actions/upload-artifact | ||
|
||
Ubuntu 20.04 comes with Freetype 2.10.1, Poppler requires at least 2.11 | ||
--- | ||
.github/workflows/build.yml | 6 +++--- | ||
1 file changed, 3 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml | ||
index f7bd2f8..c1a39cf 100644 | ||
--- a/.github/workflows/build.yml | ||
+++ b/.github/workflows/build.yml | ||
@@ -4,16 +4,16 @@ on: [push] | ||
|
||
jobs: | ||
build: | ||
- runs-on: ubuntu-20.04 | ||
+ runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Code | ||
- uses: actions/checkout@v3 | ||
+ uses: actions/checkout@v4 | ||
|
||
- name: Build project with APT | ||
run: './buildScripts/buildInstallLocallyApt' | ||
|
||
- name: Upload artifact | ||
- uses: actions/upload-artifact@v2 | ||
+ uses: actions/upload-artifact@v4 | ||
with: | ||
name: my-artifact | ||
path: pdf2htmlEX/build | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
28 changes: 28 additions & 0 deletions
28
...s/pdf2htmlex/all/patches/0.18.8.rc1-git-6f85c88/0003-Update-missing-font-workaround.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 4753c1e17c815de7773be7ffd99cfbe947e8754a Mon Sep 17 00:00:00 2001 | ||
From: Vilius Sutkus '89 <[email protected]> | ||
Date: Mon, 5 Aug 2024 21:35:29 +0300 | ||
Subject: [PATCH 3/3] Update missing font workaround | ||
|
||
--- | ||
pdf2htmlEX/src/HTMLRenderer/font.cc | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/pdf2htmlEX/src/HTMLRenderer/font.cc b/pdf2htmlEX/src/HTMLRenderer/font.cc | ||
index 9c3112b..ff27da2 100644 | ||
--- a/pdf2htmlEX/src/HTMLRenderer/font.cc | ||
+++ b/pdf2htmlEX/src/HTMLRenderer/font.cc | ||
@@ -1080,7 +1080,10 @@ static string general_font_family(GfxFont * font) | ||
// TODO: this function is called when some font is unable to process, may use the name there as a hint | ||
void HTMLRenderer::export_remote_default_font(long long fn_id) | ||
{ | ||
- f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; | ||
+// Workaround for https://github.com/opendocument-app/pdf2htmlEX-Android/issues/94 | ||
+// Workaround for https://github.com/opendocument-app/OpenDocument.droid/issues/348 | ||
+// f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; | ||
+ f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:visible;}" << endl; | ||
} | ||
|
||
void HTMLRenderer::export_local_font(const FontInfo & info, GfxFont * font, const string & original_font_name, const string & cssfont) | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
versions: | ||
"0.18.8.rc1-20240905-git": | ||
"0.18.8.rc1-git-6f85c88": | ||
folder: all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
sources: | ||
"1.2.9": | ||
url: | ||
- "https://github.com/ViliusSutkus89/OpenSourceMirrors/releases/download/wvWare-1.2.9/wv-1.2.9.tar.gz" | ||
- "https://github.com/opendocument-app/wvWare/releases/download/v1.2.9/wv-1.2.9.tar.gz" | ||
- "http://www.nl.abisource.com/downloads/wv/1.2.9/wv-1.2.9.tar.gz" | ||
sha256: "4c730d3b325c0785450dd3a043eeb53e1518598c4f41f155558385dd2635c19d" | ||
patches: | ||
"1.2.9": | ||
- patch_file: "patches/wv-1.2.9-gsf-meta-names.patch" | ||
- patch_file: "patches/1.2.9/gsf-meta-names.patch" | ||
# https://gitweb.gentoo.org/repo/gentoo.git/tree/app-text/wv/files | ||
- patch_file: "patches/wv-1.2.9-C99-decls.patch" | ||
- patch_file: "patches/wv-1.2.9-format-security.patch" | ||
- patch_file: "patches/wv-1.2.9-gcc14-build-fix.patch" | ||
|
||
- patch_file: "patches/wvWare-library.patch" | ||
- patch_file: "patches/1.2.9/C99-decls.patch" | ||
- patch_file: "patches/1.2.9/format-security.patch" | ||
- patch_file: "patches/1.2.9/gcc14-build-fix.patch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
recipes/wvware/all/patches/1.2.9/0001-gsf-meta-names.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 4105b1e53c1c98d0b4b5d139090de6d7b07ebd2e Mon Sep 17 00:00:00 2001 | ||
From: Andreas Stefl <[email protected]> | ||
Date: Wed, 18 Sep 2024 15:54:59 +0200 | ||
Subject: [PATCH 1/4] gsf meta names | ||
|
||
--- | ||
wvSummary.c | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/wvSummary.c b/wvSummary.c | ||
index 980b856..27b5fed 100644 | ||
--- a/wvSummary.c | ||
+++ b/wvSummary.c | ||
@@ -33,6 +33,7 @@ | ||
#include <gsf/gsf-msole-utils.h> | ||
#include <gsf/gsf-docprop-vector.h> | ||
#include <gsf/gsf-meta-names.h> | ||
+#include <gsf/gsf-doc-meta-data.h> | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
Oops, something went wrong.