This project compile PDFium to mobile platforms. Current project compiles to:
- iOS
- Android
- ninja (brew install ninja)
- python3
- pip (generally called pip3 for python3)
-
Get the source:
git clone github.com/prsolucoes/mobile-pdfium.git
-
Install pip requirements:
pip3 install -r requirements.txt
or
pip3 install -r requirements.txt --user
-
Get Google Depot Tools:
python3 make.py run build-depot-tools
-
Get Chromium:
python3 make.py run build-chromium
-
Get PDFium:
python3 make.py run build-pdfium
-
Apply patchs:
Check **patchs** section of this file
-
Compile for iOS:
python3 make.py run build-ios
-
Install iOS libraries:
python3 make.py run install-ios
Obs:
- The file make.py need be executed with python3.
- The steps 1, 2, 3, 4, 5 and 6 you only need make one time.
- Remove assert lines from libjpeg_turbo build files about iOS check:
- pdfium/build/secondary/third_party/libjpeg_turbo/BUILD.gn
- chromium/build/secondary/third_party/libjpeg_turbo/BUILD.gn
- chromium/third_party/BUILD.gn
- Replace line 62 from pdfium/core/fxcrt/fx_system.h:
- FROM #include <Carbon/Carbon.h>
- TO #include <CoreGraphics/CoreGraphics.h>
- Add to file pdfium/BUILD.gn on line 243, the code:
if (is_ios) {
libs += [
"CoreGraphics.framework"
]
}
- Add to file pdfium/BUILD.gn on line 1132, the code:
if (is_ios) {
sources += [ "core/fxge/apple/fx_apple_platform.cpp" ]
}
- Add to file pdfium/BUILD.gn on line 1158, the code:
if (is_ios) {
sources += [
"core/fxge/apple/apple_int.h",
"core/fxge/apple/fx_mac_imp.cpp",
"core/fxge/apple/fx_quartz_device.cpp",
]
}
- Replace line 18 from pdfium/core/fxge/apple/apple_int.h:
- FROM #include <Carbon/Carbon.h>
- TO #include <CoreGraphics/CoreGraphics.h>
- Disable neon file for ARM (armv7) of libjpeg_turbo if you have problems like me. Delete line 119 of file pdfium/build/secondary/third_party/libjpeg_turbo/BUILD.gn:
"simd/jsimd_arm_neon.S",
Obs: If anyone know how to make the patch from command line, please, help with this.