我在我的android应用程序中使用mupdf库来查看pdf文件.任何人都可以告诉我如何使用mupdf库获取pdf的每个页面的位图图像?提前致谢....
我有两个问题1)注释不起作用2)我想在线阅读pdf文档
我使用此链接构建MuPDF http://mupdf.com/doc/how-to-build-mupdf-for-android
1)我得到项目mupdf/platform/android我运行该默认应用程序注释工作正常,但我创建该项目到库文件,他们要求保存但注释不保存.
2)它将读取本地文件,但我也想读取在线文件.我的android代码
pdf = (TextView) findViewById(R.id.pdf);
onPdf = (TextView) findViewById(R.id.onPdf);
pdf.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse(path);
Intent intent = new Intent(context, MuPDFActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.setData(uri);
startActivity(intent);
}
});
onPdf.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse(netPath);
Intent intent = new Intent(context, MuPDFActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.setData(uri);
startActivity(intent);
}
});
Run Code Online (Sandbox Code Playgroud)
修改了MuPDFActivity - 我改变所有文件都是打开openBuffer方法
private MuPDFCore openBuffer(byte buffer[]) {
System.out.println("Trying to open byte buffer");
try {
String magic = ""; …Run Code Online (Sandbox Code Playgroud) 我已成功将 mupdf 集成到我的项目中。现在我可以浏览pdf,添加新的注释和编辑,但我不知道如何将数字签名嵌入到pdf中。
任何人都可以建议我将数字签名嵌入到 pdf 中的步骤吗?
(请忽略空方块。)
如何<span>在第二种情况下正确定位蓝色元素?
<view style="height: 45em;">
<pdf-page> <!-- position: relative -->
<text class="textLayer"> <!-- position: absolute -->
<span style="left: 417.34px; top: 37.8391px; ..."></span> <!-- position: absolute -->
</text>
<svg width="595px" height="842px" preserveAspectRatio="none" viewBox="0 0 595 842" xmlns="http://www.w3.org/2000/svg" version="1.1">
<g ?><g ?><text><tspan></tspan></text></g></g>
</svg>
</pdf-page>
</view>
Run Code Online (Sandbox Code Playgroud)
这是 stackoverflow 中的完整案例(/* ? */在单击 Show code snippet 后查看第二个窗格):
@namespace url(http://www.w3.org/1999/xhtml);
@namespace svg url(http://www.w3.org/2000/svg);
/*pdf.css*/ …Run Code Online (Sandbox Code Playgroud)我可以使用MuPDF库在iphone/ipad上开发电子书阅读器吗?
你有什么好主意吗?请帮我一些好的教程.
IM目前使用MuPDF在我的Android应用程序,当我建立了它从源(基于的ReadMe.txt)它只是生成.so文件armeabi和armeabi-v7a,但不x86和MIPS,当我胳膊上拱装置(三星Galaxy Tab 7)运行应用程序,它看起来很不错.但不是在mips拱形.我的问题是我如何生成x86和MIPS共享目标文件?如果有任何其他解决方案,我会很感激...
PS:我正在使用android ndk r8d,我试图改变,android-ndk-r6b但我有同样的问题.
我正在使用MUPDF作为一个Android项目,但有一些Android用户存在问题.我得到的报告如下:
java.lang.UnsupportedOperationException: Not supported
E/AndroidRuntime( 4677): at com.odilogy.mupdf.ReaderView.getSelectedView(ReaderView.java:664)
E/AndroidRuntime( 4677): at android.widget.AdapterView.onInitializeAccessibilityEvent(AdapterView.java:951)
E/AndroidRuntime( 4677): at android.widget.AdapterView.onRequestSendAccessibilityEvent(AdapterView.java:926)
E/AndroidRuntime( 4677): at android.view.ViewGroup.requestSendAccessibilityEvent(ViewGroup.java:704)
E/AndroidRuntime( 4677): at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:4952)
E/AndroidRuntime( 4677): at android.view.View.sendAccessibilityEventUnchecked(View.java:4933)
E/AndroidRuntime( 4677): at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:6675)
E/AndroidRuntime( 4677): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 4677): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4677): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 4677): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 4677): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4677): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 4677): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 4677): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 4677): at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
此行发生此异常:
public View getSelectedView() {
throw new UnsupportedOperationException("Not supported");
} …Run Code Online (Sandbox Code Playgroud) 不幸的是,我还没有找到关于这一点的任何文件,所以也许我做错了什么.
我使用mupdf示例用于android,我稍微修改了MuPDFActivity的源代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAlertBuilder = new AlertDialog.Builder(this);
if (core == null) {
core = (MuPDFCore)getLastNonConfigurationInstance();
if (savedInstanceState != null && savedInstanceState.containsKey("FileName")) {
mFileName = savedInstanceState.getString("FileName");
}
}
if (core == null) {
Intent intent = getIntent();
byte buffer[] = null;
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
Uri uri = intent.getData();
try {
InputStream inputStream = new FileInputStream(new File(uri.toString()));
int len = inputStream.available();
buffer = new byte[len];
inputStream.read(buffer, 0, len);
inputStream.close();
} catch (Exception e) {
Log.e(TAG, e.getMessage());
} …Run Code Online (Sandbox Code Playgroud) 我正在使用mupdf在我的c ++应用程序中渲染PDF,但我还需要编辑PDF(例如插入图片),但我不能在我的生活中弄清楚如何 - 它没有很好地记录.Ghostscript说在mupdf中有一个API来修改PDF文件http://www.ghostscript.com/MuPDF.html.
最后,我希望能够使用MuPDF编辑PDF而不是使用其他库.
任何帮助将不胜感激,谢谢!
我正在尝试在MuPDF中启用调试选项.出于某种原因,他们使用了我想要使用的代码#ifndef NDEBUG并使其#endif变灰.我在整个图书馆搜索,但找不到任何地方定义的任何NDEBUG痕迹.我已经设法通过添加#undef NDEBUG标题来解决这个问题,但我想知道是否有更多非侵入性的方法来执行此操作.
那么,你能从makefile中启用"#ifndef /#endif"块吗?
另外,为什么你会使用#ifndef灰色代码?不应该是#ifdef NDEBUG吗?