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 Jun 20, 2023
1 parent ee36e9c commit 4ffbda4
Show file tree
Hide file tree
Showing 118 changed files with 34,010 additions and 92 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
14 changes: 10 additions & 4 deletions libs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ add_project_arguments('-fPIC', language: 'cpp')

cpp = meson.get_compiler('cpp')
libdir = meson.current_source_dir() + '/lib'
podofo_dep = cpp.find_library('libpodofo', dirs: libdir)

crypto_dep = dependency('libcrypto')
cryptop_dep = dependency('libcrypto++', required: false)
Expand All @@ -16,15 +17,20 @@ 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)
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/', '/usr/include/podofo-0.9')

inc_a = include_directories('sign-sdk/include', 'sign-sdk/src', 'shared/src/', '/usr/include/podofo-0.9')
inc_so = include_directories('pkcs11/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
14 changes: 4 additions & 10 deletions libs/sign-sdk/include/PdfSignatureGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@

#ifndef _PDFSIGNATUREGENERATOR_H_
#define _PDFSIGNATUREGENERATOR_H_
#include <podofo/base/PdfWriter.h>
#include <podofo/doc/PdfMemDocument.h>
#include <podofo/doc/PdfSignOutputDevice.h>
#include <podofo/doc/PdfSignatureField.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 @@ -63,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
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 4ffbda4

Please sign in to comment.