2021-09-27 11:14:20 +02:00
|
|
|
# PDF4QT
|
2023-07-08 13:28:56 +02:00
|
|
|
|
2023-09-08 16:24:49 +02:00
|
|
|
**(c) Jakub Melka 2018-2023**
|
2021-09-27 11:14:20 +02:00
|
|
|
|
|
|
|
**Mgr.Jakub.Melka@gmail.com**
|
2022-07-17 16:15:03 +02:00
|
|
|
|
2022-07-17 16:10:42 +02:00
|
|
|
**https://jakubmelka.github.io/**
|
2021-09-27 11:14:20 +02:00
|
|
|
|
|
|
|
This software is consisting of PDF rendering library, and several
|
|
|
|
applications, such as advanced document viewer, command line tool,
|
|
|
|
and document page manipulator application. Software is implementing PDF
|
|
|
|
functionality based on PDF Reference 2.0. It is written and maintained
|
|
|
|
by Jakub Melka.
|
|
|
|
|
2022-01-01 14:33:31 +01:00
|
|
|
*Software works on Microsoft Windows / Linux.*
|
2021-09-27 11:14:20 +02:00
|
|
|
|
2022-01-01 14:33:31 +01:00
|
|
|
Software is provided without any warranty of any kind.
|
2021-09-27 11:14:20 +02:00
|
|
|
|
2023-10-21 16:50:28 +02:00
|
|
|
Should you find this software beneficial, your support would be greatly appreciated [:heart: Sponsor](https://github.com/sponsors/JakubMelka)!
|
|
|
|
|
2021-09-27 11:14:20 +02:00
|
|
|
## 1. ACKNOWLEDGEMENTS
|
|
|
|
|
|
|
|
This software is based in part on the work of the Independent JPEG Group.
|
|
|
|
|
|
|
|
Portions of this software are copyright © 2019 The FreeType
|
|
|
|
Project (www.freetype.org). All rights reserved.
|
|
|
|
|
|
|
|
## 2. LEGAL ISSUES
|
|
|
|
|
|
|
|
Both library and viewer uses more benevolent LGPL license, so it is more
|
|
|
|
usable in commercial software, than GPL code only. Please see attached
|
|
|
|
file - LICENSE.txt to see details. This software also uses several
|
|
|
|
third party software, and user of this software must also respect licenses
|
|
|
|
of third party libraries.
|
|
|
|
|
|
|
|
## 3. FEATURES
|
|
|
|
|
|
|
|
Software have following features (the list is not complete):
|
|
|
|
|
|
|
|
- [x] multithreading support
|
|
|
|
- [x] hardware accelerated rendering
|
|
|
|
- [x] encryption
|
|
|
|
- [x] color management
|
|
|
|
- [x] optional content handling
|
|
|
|
- [x] text layout analysis
|
|
|
|
- [x] signature validation
|
|
|
|
- [x] annotations
|
|
|
|
- [x] form filling
|
|
|
|
- [x] text to speech capability
|
|
|
|
- [x] editation
|
|
|
|
- [x] file attachments
|
|
|
|
- [x] optimalization (compressing documents)
|
|
|
|
- [x] command line tool
|
|
|
|
- [x] audio book conversion
|
|
|
|
- [x] internal structure inspector
|
2021-10-23 17:01:17 +02:00
|
|
|
- [x] compare documents
|
2022-02-06 18:13:43 +01:00
|
|
|
- [x] static XFA support (readonly, simple XFA only)
|
2022-06-01 19:57:41 +02:00
|
|
|
- [x] electronically/digitally sign documents
|
2022-06-30 15:37:17 +02:00
|
|
|
- [x] public key security encryption
|
2023-12-02 18:41:30 +01:00
|
|
|
- [ ] 3D PDF support *(planned in year 2024)*
|
|
|
|
- [ ] create fillable forms *(planned in year 2024)*
|
|
|
|
- [ ] watermarks / headers / footers *(planned in year 2024)*
|
|
|
|
- [ ] presentation application *(planned in year 2024)*
|
2021-09-27 11:14:20 +02:00
|
|
|
|
|
|
|
## 4. THIRD PARTY LIBRARIES
|
|
|
|
|
|
|
|
Several third-party libraries are used.
|
|
|
|
|
|
|
|
1. libjpeg, see https://www.ijg.org/
|
|
|
|
2. FreeType, see https://www.freetype.org/index.html, FTL license used
|
|
|
|
3. OpenJPEG, implementing Jpeg2000, see https://www.openjpeg.org/, 2-clause MIT license
|
|
|
|
4. Qt, https://www.qt.io/, LGPL license used
|
|
|
|
5. OpenSSL, https://www.openssl.org/, Apache 2.0 license
|
|
|
|
6. LittleCMS, http://www.littlecms.com/
|
|
|
|
7. zlib, https://zlib.net/
|
|
|
|
|
|
|
|
## 5. CONTRIBUTIONS
|
|
|
|
|
|
|
|
If you want to contribute to this project, it is required, that you (contributor)
|
|
|
|
fill and digitally sign document [Contributor License Agreement](CLA/Contributor_License_Agreement.pdf),
|
|
|
|
because I want to have a freedom to do whatever I want with my library, without obligation
|
|
|
|
to someone else. But I would strongly prefer, if you want to contribute, to contribute
|
|
|
|
in a form of testing, consultation, giving advices etc. I would like to write this library
|
|
|
|
entirely by myself.
|
|
|
|
|
2023-07-08 13:28:56 +02:00
|
|
|
## 6. INSTALLING
|
|
|
|
|
|
|
|
### Windows
|
|
|
|
|
|
|
|
The [Release page](https://github.com/JakubMelka/PDF4QT/releases) lists binaries for Windows, both with and without an installer.
|
|
|
|
|
|
|
|
### Arch Linux
|
|
|
|
|
|
|
|
A [pdf4qt-git](https://aur.archlinux.org/packages/pdf4qt-git) package is available in the AUR.
|
2021-09-27 11:14:20 +02:00
|
|
|
|
2023-07-08 13:28:56 +02:00
|
|
|
## 7. COMPILING
|
|
|
|
|
|
|
|
This software can be compiled on both Windows and Linux. A compiler supporting the C++20 standard is needed.
|
|
|
|
|
|
|
|
On Windows, you can use Visual Studio 2022 or MinGW.
|
|
|
|
|
|
|
|
On Linux, a GCC version >= 8 should work, altough we tested it with GCC 11.
|
2022-10-17 20:09:43 +02:00
|
|
|
|
2023-07-05 13:03:31 +02:00
|
|
|
### Compiling from sources
|
|
|
|
|
|
|
|
1. Install [vcpkg](https://vcpkg.io/en/getting-started.html)
|
|
|
|
|
|
|
|
git clone https://github.com/Microsoft/vcpkg.git
|
|
|
|
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
|
2023-07-26 09:18:08 +02:00
|
|
|
VCPKG_ROOT=$(pwd)/vcpkg
|
|
|
|
|
|
|
|
Check that vcpkg path is correct: `$VCPKG_ROOT/vcpkg --version`.
|
2023-07-05 13:03:31 +02:00
|
|
|
|
|
|
|
2. Build PDF4QT
|
|
|
|
|
|
|
|
2.1 Clone repo
|
|
|
|
|
|
|
|
git clone https://github.com/JakubMelka/PDF4QT
|
2023-07-08 13:28:56 +02:00
|
|
|
cd PDF4QT
|
2023-07-05 13:03:31 +02:00
|
|
|
|
|
|
|
2.2 Configure
|
|
|
|
|
2023-12-02 18:41:30 +01:00
|
|
|
cmake -B build -S . -DPDF4QT_INSTALL_QT_DEPENDENCIES=0 -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX='/' -DCMAKE_BUILD_TYPE=Release
|
2023-07-05 13:03:31 +02:00
|
|
|
|
2023-07-08 13:28:56 +02:00
|
|
|
For a debug build, append `-DCMAKE_BUILD_TYPE=Debug`.
|
|
|
|
|
2023-07-05 13:03:31 +02:00
|
|
|
2.3 Build
|
|
|
|
|
|
|
|
cmake --build build
|
|
|
|
|
2023-07-26 09:18:08 +02:00
|
|
|
Use the [`-j` switch](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-build-j) to build multiple files in parallel.
|
|
|
|
|
2023-07-05 13:03:31 +02:00
|
|
|
2.4 Install
|
|
|
|
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2023-07-26 09:18:08 +02:00
|
|
|
To uninstall, run `sudo xargs rm < ./build/install_manifest.txt`.
|
|
|
|
|
2023-07-08 13:28:56 +02:00
|
|
|
### Using Qt Creator (both Windows/Linux)
|
2022-10-17 20:09:43 +02:00
|
|
|
1. Download Qt 6.4 or higher, and VCPKG package manager (https://vcpkg.io/en/index.html)
|
|
|
|
2. Open Qt Creator and configure the project
|
2022-01-01 14:33:31 +01:00
|
|
|
3. Build
|
2022-10-17 20:09:43 +02:00
|
|
|
|
|
|
|
### CMAKE Compilation Options
|
|
|
|
|
2023-07-08 13:28:56 +02:00
|
|
|
Several important compilation options are available and should be set before building. On Windows,
|
|
|
|
CMake can prepare a Wix project to create a *.msi installer package.
|
2022-10-17 20:09:43 +02:00
|
|
|
|
|
|
|
| Option | Platform | Description |
|
|
|
|
| ------------------------------------ | ---------|--------------------------------------------------------- |
|
|
|
|
| `PDF4QT_INSTALL_MSVC_REDISTRIBUTABLE` | Windows |Includes MSVC redistributable in installation |
|
|
|
|
| `PDF4QT_INSTALL_PREPARE_WIX_INSTALLER` | Windows |Prepare .msi installator using Wix installer |
|
|
|
|
| `PDF4QT_INSTALL_DEPENDENCIES` | Any |Install dependent libraries into installation directory |
|
|
|
|
| `PDF4QT_INSTALL_QT_DEPENDENCIES` | Any |Install Qt dependent libraries into installation directory|
|
|
|
|
|
|
|
|
Following important variables should be set or checked before any attempt to compile this project:
|
|
|
|
|
|
|
|
| Variable | Platform | Description |
|
|
|
|
| ------------------------------------ | ---------|--------------------------------------------------------- |
|
|
|
|
| `PDF4QT_QT_ROOT` | Any |Qt installation directory |
|
|
|
|
| `QT_CREATOR_SKIP_VCPKG_SETUP` | Any |Enable or disable automatic vcpkg setup |
|
2023-01-15 18:56:30 +01:00
|
|
|
| `CMAKE_PROJECT_INCLUDE_BEFORE` | Any |Should be set to package manager auto setup |
|
|
|
|
| `CMAKE_TOOLCHAIN_FILE` | Any |Should be set to toolchain |
|
2023-07-08 13:28:56 +02:00
|
|
|
| `CMAKE_BUILD_TYPE` | Any |Can be Release (default) or Debug |
|
2023-01-15 18:56:30 +01:00
|
|
|
|
|
|
|
#### Sample setup on Windows
|
|
|
|
|
|
|
|
Following set of variables gives sample setup for MS Windows. It is minimal initial configuration
|
|
|
|
to be able to built Debug build on MS Windows.
|
|
|
|
|
|
|
|
| Key | Value |
|
|
|
|
| ------------------------------- | -------------------------------------------------------------|
|
|
|
|
| `CMAKE_BUILD_TYPE` | Debug |
|
|
|
|
| `CMAKE_CXX_COMPILER` | %{Compiler:Executable:Cxx} |
|
|
|
|
| `CMAKE_C_COMPILER` | %{Compiler:Executable:C} |
|
|
|
|
| `CMAKE_GENERATOR` | Ninja |
|
|
|
|
| `CMAKE_PREFIX_PATH` | %{Qt:QT_INSTALL_PREFIX} |
|
|
|
|
| `CMAKE_PROJECT_INCLUDE_BEFORE` | %{IDE:ResourcePath}/package-manager/auto-setup.cmake |
|
|
|
|
| `CMAKE_TOOLCHAIN_FILE` | %{Qt:QT_INSTALL_PREFIX}/lib/cmake/Qt6/qt.toolchain.cmake |
|
|
|
|
| `PDF4QT_QT_ROOT` | C:/Programming/Qt/6.4.0/msvc2019_64 |
|
|
|
|
| `QT_QMAKE_EXECUTABLE` | %{Qt:qmakeExecutable} |
|
|
|
|
|
2022-10-17 20:09:43 +02:00
|
|
|
|
|
|
|
### Tested Compilers - Windows
|
|
|
|
- Visual Studio 2022 (Microsoft Visual C++ Compiler 17.1)
|
|
|
|
- MinGW 11.2.0
|
|
|
|
|
|
|
|
### Tested Compilers - Linux
|
2023-07-08 13:28:56 +02:00
|
|
|
- GCC 13.1.1
|
2021-09-27 11:14:20 +02:00
|
|
|
|
2023-07-08 13:28:56 +02:00
|
|
|
## 8. DISCLAIMER
|
2021-09-27 11:14:20 +02:00
|
|
|
|
|
|
|
I wrote this project in my free time. I hope you will find it useful!
|