There is build-in PDF render engine for iOS, but it doesn't solve the "Transparency Flattening" issue. Hence I try to integrate MuPDF 1.3 into project. I tried to use reference the MuPDF project, and it failed. Then I build debug static libraries for each architecture, and use "Library Search Paths" and "Other Link Flags" to separate the linked library while building binary of different architecture, but XCode keeps showing "Undefined symbols for architecture armxxx". Finally, I built the release version static library of MuPDF, which should compatible for all architecture, and XCode still keeps showing same thing as before. Does there anyone integrate and compile MuPDF 1.3 successfully? Please give me some hint. Thanks a lot.
Sorry for the late answer but it could help people a day or another. As I had to integrate the MuPDF library into one of my (Swift) project, I generated the static fat libraries and integrate them into Xcode.
Here you go with a step-by-step quick tutorial:
mupdf/platform/ios
i386
and x86_64
armv7
and arm64
mupdf/build/
release-ios-i386-x86_64
and release-ios-armv7-arm64
lipo -create ./*/libcurl.a -output 'libcurl.a' ; lipo -create ./*/libfreetype.a -output 'libfreetype.a' ; lipo -create ./*/libjbig2dec.a -output 'libjbig2dec.a' ; lipo -create ./*/libjpeg.a -output 'libjpeg.a' ; lipo -create ./*/libmujs.a -output 'libmujs.a' ; lipo -create ./*/libmupdf.a -output 'libmupdf.a' ; lipo -create ./*/libopenjpeg.a -output 'libopenjpeg.a' ; lipo -create ./*/libz.a -output 'libz.a'
mupdf/include/mupdf
mupdf/platform/ios/
classesmupdf/platform/ios
Library Search Path
by adding the path to your library files.
$(inherited) $(PROJECT_DIR)/External/MuPDF/lib/
You should now be able to build and run your app with the library included. Use the sample project to understand how the library works or any online tutorial.
The final fat libraries are pretty big all together (~ 46mb). You could easily reduce the final size of your app by importing:
mupdf/build/release-ios-armv7-arm64
mupdf/build/
Library Search Path
for Debug
and Release
config.Once done, you will be able to build and run on Debug
on every simulator and devices. But only on devices for Release
. Which in the end you need as your app, through, the AppStore
should only run on real devices. There is no need to include debug-simulator architecture static librairies.
Here is a screenshot of all imported files into my Xcode project: