Document version, build flags and patches for bundled pdfium.dll

This commit is contained in:
Felix Kauselmann 2019-04-28 16:03:17 +02:00
parent c1c413a72d
commit 87a6645875
2 changed files with 83 additions and 0 deletions

27
dependencies/pdfium/win/VERSION vendored Normal file
View File

@ -0,0 +1,27 @@
YACReader for Windows uses a shared library version of pdfium.
pdfium branch used for building: chromium/3729
Build parameters used (gn args):
pdf_enable_v8 = false
pdf_enable_xfa = false
is_debug = false
symbol_level = 0
use_jumbo_build = true
For 32 bit builds:
target_cpu="x86"
For 64 bit builds:
target_cpu="x64"
Instructions on building pdfium can be found at https://pdfium.googlesource.com/pdfium
To build a shared library, the source code has to be patched. A patch file with the
necessary modifications can be found in this directory (pdfium_shared_library.patch).
It is recommended to always use the branch the current stable version of Chromium uses.
To get the pdfium branch corresponding to Chromium stable, look at
http://omahaproxy.appspot.com and search for the true_branch variable associated with
the current stable dev channel of Chromium.

View File

@ -0,0 +1,56 @@
From 0706085c41f645d68e29732f21da733e191abc34 Mon Sep 17 00:00:00 2001
From: Felix Kauselmann <licorn@gmail.com>
Date: Sat, 27 Apr 2019 16:57:01 +0200
Subject: [PATCH] Build a shared library
---
BUILD.gn | 3 ++-
public/fpdfview.h | 9 +++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/BUILD.gn b/BUILD.gn
index 6885fc27d..06335fcd3 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -22,6 +22,7 @@ config("pdfium_common_config") {
defines = [
"PNG_PREFIX",
"PNG_USE_READ_MACROS",
+ "FPDFSDK_EXPORTS",
]
if (!use_system_libopenjpeg2) {
@@ -132,7 +133,7 @@ jumbo_source_set("pdfium_public_headers") {
public_configs = [ ":pdfium_public_config" ]
}
-jumbo_static_library("pdfium") {
+shared_library("pdfium") {
sources = [
"fpdfsdk/fpdf_annot.cpp",
"fpdfsdk/fpdf_attachment.cpp",
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 8892da536..8453ee66e 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -154,10 +154,15 @@ typedef int FPDF_ANNOT_APPEARANCEMODE;
// Dictionary value types.
typedef int FPDF_OBJECT_TYPE;
-#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
+#if defined(_WIN32)
+#if defined(FPDFSDK_EXPORTS)
// On Windows system, functions are exported in a DLL
#define FPDF_EXPORT __declspec(dllexport)
-#define FPDF_CALLCONV __stdcall
+#define FPDF_CALLCONV __cdecl
+#else
+#define FPDF_EXPORT __declspec(dllimport)
+#define FPDF_CALLCONV __cdecl
+#endif
#else
#define FPDF_EXPORT
#define FPDF_CALLCONV
--
2.20.1.windows.1