Skip to content

Commit

Permalink
chore: use of proprietary podofo
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Oct 16, 2023
1 parent 1da1196 commit bc5d3d4
Show file tree
Hide file tree
Showing 118 changed files with 34,009 additions and 88 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -36,8 +36,10 @@ jobs:
sudo apt install -y g++ libcrypto++-dev
libcrypto++8 libcurl4-openssl-dev libfontconfig1-dev
libfreetype6-dev libpcsclite-dev libpcsclite1 libpng-dev
libpodofo-dev libssl-dev libssl1.1 libxml2 libxml2-dev
pcscd pkg-config python3-pip unzip
libssl-dev libssl1.1 libxml2 libxml2-dev
pcscd pkg-config python3-pip unzip;
curl -sL "https://github.com/M0Rf30/cie-middleware-linux/releases/download/podofo-1.4.2/libpodofo-1.4.2.tar.gz" -o libpodofo.tar.gz;
tar xf libpodofo.tar.gz --directory=libs/lib
- uses: actions/setup-python@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -44,7 +44,6 @@ Sono necessarie le seguenti librerie:
* openssl
* pcsclite
* pkgconf (make)
* podofo

### Istruzioni

Expand All @@ -53,6 +52,10 @@ Da terminale, spostarsi nella root del presente repo e digitare:
```sh
gradle -b cie-java/build.gradle standalone

curl -sL "https://github.com/M0Rf30/cie-middleware-linux/releases/download/podofo-1.4.2/libpodofo-1.4.2.tar.gz" -o libpodofo.tar.gz

tar xf libpodofo.tar.gz --directory=libs/lib

meson builddir libs
meson configure -Dprefix=/usr builddir
meson compile -C builddir
Expand Down
12 changes: 9 additions & 3 deletions libs/meson.build
Expand Up @@ -16,15 +16,21 @@ curl_dep = dependency('libcurl')
fontconfig_dep = dependency('fontconfig')
freetype_dep = dependency('freetype2')
png_dep = dependency('libpng')
podofo_dep = cpp.find_library('podofo', dirs: '/usr/lib/podofo-0.9/', required: true)
podofo_dep = cpp.find_library('libpodofo', dirs: libdir)
libxml2_dep = dependency('libxml-2.0', required: false)
xml2_dep = dependency('xml2', required: false)
zlib_dep = dependency('zlib')

inc_so = include_directories('pkcs11/src/.', 'shared/src/')

inc_a = include_directories('sign-sdk/include', 'sign-sdk/src', 'shared/src/')

inc_a = include_directories(
'sign-sdk/include',
'sign-sdk/include/podofo',
'sign-sdk/include/podofo/include',
'sign-sdk/include/podofo/include/podofo',
'sign-sdk/src',
'shared/src/',
)
cie_pkcs11_sources = [
'shared/src/Util/log.cpp',
'shared/src/Util/funccallinfo.cpp',
Expand Down
11 changes: 4 additions & 7 deletions libs/sign-sdk/include/PdfSignatureGenerator.h
Expand Up @@ -9,8 +9,9 @@

#ifndef _PDFSIGNATUREGENERATOR_H_
#define _PDFSIGNATUREGENERATOR_H_

#include <podofo/podofo.h>
#include "podofo/podofo.h"
#include "podofo/doc/PdfSignOutputDevice.h"
#include "podofo/doc/PdfSignatureField.h"

#include "Util/UUCByteArray.h"

Expand Down Expand Up @@ -60,11 +61,7 @@ class PdfSignatureGenerator {
const double getHeight(int pageIndex);

private:
PdfDocument* m_pPdfDocument;

PdfMemDocument* m_pPdfMemDocument;

PdfWriter* m_pPdfWriter;
PdfMemDocument* m_pPdfDocument;

PdfSignatureField* m_pSignatureField;

Expand Down
@@ -0,0 +1,44 @@
#ifndef PDF_FT_FORWARD_DECL
#define PDF_FT_FORWARD_DECL

/**
* \file Pdf3rdPartyForwardDecl.h
*
* Forward declare some types that we use in our public API but don't want to
* include the headers for directly. We can't do a nice simple forward
* declaration because most of these libraries have typedefs everywhere.
*
* We don't want to include things like freetype directly in our public headers
* because:
*
* - They dump a huge amount of cruft into the top level namespace
*
* - Programs that haven't gone through the apallingly convoluted process required
* to add freetype's header path can't include podofo's headers even if they have no
* intention of using any freetype-related font features.
*/

#ifdef __cplusplus
extern "C" {
#endif

// Provide access to FT_Library
struct FT_LibraryRec_;
typedef struct FT_LibraryRec_ *FT_Library;

// Provide access to FT_Face
struct FT_FaceRec_;
typedef struct FT_FaceRec_* FT_Face;

#if defined(PODOFO_HAVE_FONTCONFIG)
// Fontconfig
struct _FcConfig;
typedef struct _FcConfig FcConfig;
#endif

#ifdef __cplusplus
}; // end extern "C"
#endif

// end PDF_FT_FORWARD_DECL
#endif

0 comments on commit bc5d3d4

Please sign in to comment.