PyMuPDF 使用错误的颜色突出显示关键词。

huangapple go评论79阅读模式
英文:

Keywords being highlighted in wrong color using PyMuPDF

问题

我正在进行一些基本的关键词高亮显示,但遇到了一个奇怪的问题。当我输入具有浮点RGB值的描边颜色时(如下所示),高亮显示会以多种不同的颜色显示。在这种情况下,我希望高亮显示为橙色。有些单词是橙色,而其他一些则更接近红色。你知道这里发生了什么吗?如果我将RGB值更改为整数,高亮显示的颜色就都相同了。请告诉我如果你需要看到任何其他代码。

英文:

I'm doing some basic keyword highlighting, but I'm running into a strange issue. When I enter a stroke color with floating point RGB values (as shown below), the highlights come out in multiple different colors. In this case, I want the highlights to be orange. Some words are orange while others are more red. Any idea what's going on here? If I change the the RGB values to integers, the highlight colors are all the same. Please let me know if there's any additional code you need to see.

annot = page.add_highlight_annot(word)
annot.set_colors(stroke=(1, 0.5, 0))
annot.update()

With floating point - (1, 0.5, 0)
PyMuPDF 使用错误的颜色突出显示关键词。

With integers - (1, 1, 0)
PyMuPDF 使用错误的颜色突出显示关键词。

答案1

得分: 1

这是一张所有文字都被突出显示的图片。相邻的单词显示出一些颜色重叠,颜色明显较深。

英文:

Here is an image where all words are highlighted. Neighbouring words show a small color overlap, that is significantly darker than the rest.
PyMuPDF 使用错误的颜色突出显示关键词。

huangapple
  • 本文由 发表于 2023年6月22日 09:16:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76528081.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定