You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main viewer app. This code is difficult to work with, but has the most features and pre-renders neighboring pages into a page cache for faster page turning performance.
mupdf-android-viewer-mini
This is a minimalist viewer which has fewer features but is designed to be easy to understand and modify. It does not (currently) have high-resolution zooming, and it does not use the swipe gesture to flip pages (it requires the user to tap on the side of the screen to flip pages).
熟悉而又陌生的MuPdf
说起MuPdf,其实这个库曾经听说过并使用过很久了。最早要追溯到我写WPF的时候就用到了。那个时候还是通过DllImport的方式来调用VC的核心库来实现的。由于当时已经有人帮我封装好主要的API了。所以对MuPdf这个库本身来说,还是比较陌生的。算是
从安卓pdf应用角度重新认识MuPdf
事实上MuPdf已经出了AppKit,上次我看了以后发现这是一个闭源的组件,demo给的是水印版本。顿时没了兴致。
说好的开源精神在哪里?节操哪?(还让我怎么白嫖?)
不过这次由于还是要探索一下这个组件的功能,所以重新开始学习下
其实“白嫖”版本还是有的!
上次我浏览MuPdf官网的时候,AppKit被放在很显眼的位置(挣钱嘛不寒颤),我想当然的认为就没有免费版了。
其实你打开MuPdf的Document。
实际上开源的安卓Lib还不只一个,有两个!
The main viewer app. This code is difficult to work with, but has the most features and pre-renders neighboring pages into a page cache for faster page turning performance.
This is a minimalist viewer which has fewer features but is designed to be easy to understand and modify. It does not (currently) have high-resolution zooming, and it does not use the swipe gesture to flip pages (it requires the user to tap on the side of the screen to flip pages).
mupdf-android-viewer
先从开源部分开始入手,那么选mupdf-android-viewer还是mupdf-android-viewer-mini那?都是老司机了肯定选mupdf-android-viewer啦。
从上面的文档入手
使用Android Studio编译,然而jni并不是“本地”的
需要执行git submodule update --init
这些工作做完后,demo程序就构建完成了!
开源版安卓MuPdf功能梳理
还是从表面入手解析。
其中前面属于基本功能,第三个内容比较有价值,至少在商业项目中有客户提出类似需求
开源版安卓MuPdf项目结构梳理
可以参考官网文档说明Working on the MuPDF Library
还是比较清晰的架构,当然还有一些第三方的类库这里就不画出来了
C#相关支持回顾
酸腐一下,孔子曰:
其实WPF这条路走的和安卓有异曲同工之妙
都是需要一个中间件项目来连接,区别在于安卓的纽带是JNI
而WPF用的是dllimport
当然WPF还多走一步,由于C#只能运行VC环境编译的dll才能用。
好在适配这么麻烦的活还是有“活雷锋”的!
The text was updated successfully, but these errors were encountered: