gpt4 book ai didi

android - 使用 MuPDF 像翻转板一样水平翻转

转载 作者:太空宇宙 更新时间:2023-11-03 11:11:45 24 4
gpt4 key购买 nike

我在android中实现了MuPDf打开,查看,搜索,设置书签 等用于 PDF。现在我想要水平翻转的动画效果,即类似于在 FlipBoard 应用程序中以水平方式使用的效果。

我还需要知道如何突出显示搜索文本。我正在使用 Librelio's code

我浏览了如下链接:

Link 1

请帮忙。

最佳答案

 I also need to know that how can i highlight the Search Text. 

PageView.java of MuPDF:

private static final int HIGHLIGHT_COLOR = 0x802572AC; //adjust the color

...//some code of PageView.java

public void setPage(int page, PointF size) {

...//code of PageView.setPage(int page, PointF size)

// this is the part where the hightlighting happens
if (!mIsBlank && mSearchBoxes != null) {
paint.setColor(HIGHLIGHT_COLOR);
for (RectF rect : mSearchBoxes)
canvas.drawRect(rect.left*scale, rect.top*scale,
rect.right*scale, rect.bottom*scale, paint);

// you can customize it, e.g.
// int margin = 5
//canvas.drawRect((rect.left - margin) * scale, (rect.top - margin) * scale,
//(rect.right + margin) * scale, (rect.bottom + margin) * scale, paint);
}
}

要开始搜索,只需调用:

new SearchTask(context, mupdfCore).go("searchText", 1, 0, -1);

关于android - 使用 MuPDF 像翻转板一样水平翻转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23213394/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com