How to integrate MuPDF in iOS project
Asked Answered
R

2

6

How can I integrate the mupdf library into an existing iOS project? I can run the provided source on my device and simulator, but I can't seem to manage to add it to my project correctly. I tried linking and importing the compiled static libraries but it only works in the simulator, even if I use lipo to build a fat library with all the architectures (armv7 armv7s arm64 i386). In this case the error is

file was built for archive which is not the architecture being linked (armv7s)

Ideally i would like to have it added as a submodule for ease of upgrading, I tried that too, but i can't get xcode to recognize where the built libraries are.

Roughandtumble answered 18/2, 2014 at 16:23 Comment(5)
Is it necessary to use MuPDF? Note iOS has its own PDF libraries.Leung
I know, there are some integrated ways (UIWebView, Tiled view), but they're not as efficient. There are other libraries, but they're extremely pricy.Roughandtumble
iOS contains a very specific framework to read/render/create PDF files. Search CGPDFDocument.Leung
I'm aware of that and looked into it before diving into MuPDF, but i need some of the features it provides. Namely form filling and annotations support.Roughandtumble
Have you find a way to do that ? I have the same problem. I can build and run the demo project but can't build it by my self.Ingratitude
F
3

I was able to generate and integrate the MuPDF library for all architectures. I wrote a small step-by-step tutorial on this post.

I hope it will help you ! Cheers

Flosi answered 29/6, 2015 at 9:26 Comment(0)
F
3

The easiest way is probably to use the MuPDF CocoaPod. There is an example application based on that pod.

Fart answered 5/7, 2015 at 20:33 Comment(4)
@HenriquedaCosta I haven't do so, yet. I think it won't work currently, for a couple of reasons that could be solved with some development effort. Are you one of Artifex's commercial customers? If so I'd ask them directly.Fart
I'm not actually. I made it work using your example and creating a bridge header for my project. I can make it work with a document in the MainBundle but I just can't make it work with files i download. Any thought on that? ty anyway.Must
@HenriquedaCosta Great! It should work fine, you just need to pass the full path of the document in the right place. If you can't make it work it's probably best to start a new question with details of all the paths and the relevant code fragments. (Be aware that, as you don't have a commercial license, you will need to comply with the AGPL if you plan to distribute an app that contains mupdf!)Fart
i've created a new question for that case. Let me know if you can help at all. Thanks. #37704186Must

© 2022 - 2024 — McMap. All rights reserved.