如何使用命令行在Windows中突出显示PDF中的文本? [英] How to Highlight Text in PDF with commandline (windows)?

查看:118
本文介绍了如何使用命令行在Windows中突出显示PDF中的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种突出显示单词(例如 某些单词[0-9] )的方法,或者在某些单面PDF中用给定单词更好地整行显示。
这将是Windows上批处理过程的一部分,因此我需要通过命令行方式来执行此操作。我看过Ghostscript,但看不到它的用法。

I'm looking for a way to highlight words (e.g."some words [0-9]") or better the whole line with the given words in it, in some onesided PDFs. It will be part of a Batch-process on Windows, so i need a command line way to do this. I've looked at Ghostscript, but can not see how it is to be used.

希望我没做错什么-我调查了其他问题,主要是使用正则表达式自动为PDF文件添加注释,但这对我有所帮助不完全是,英语不是我的母语-您可能已经注意到了。

hope i didnt made something wrong - i looked into other questions, mainly Add comments to PDF files automagically with regular expressions but this helped me not really, also english is not my native language - as you maybe have noticed already.

预先感谢

推荐答案

Ghostscript无法做到这一点。通用文本工具也无法使用,因为(1)大多数PDF的文本命令都位于压缩块中,并且(2)文本通常没有以任何标准方式进行编码。有时,字体提供了ToUnicode映射,但通常甚至不提供这种映射;(3)看起来像文本的东西甚至可能不是文本-可能只是位图图像。

Ghostscript can't do this. Generalized text tools also can't because (1) most PDF's have the text commands in compressed blocks, and (2) text often is not 'encoded' in any standard way. Sometimes the font provides a ToUnicode map, but often not even that and (3) what looks like text may not even be text -- it may just be bitmapped images.

类似 mutool clean -d'和 expand PDF,以便解决(1)的问题-可以在PDF中找到文本命令,但是您仍然可能会遇到类似这样的情况:

A tool like 'mutool clean -d' and "expand" a PDF so that (1) is solved -- text commands can be found in the PDF, but you still may have things like:

(!"##$) Tj

而不是由于(2)的Hello。然后,即使使用了标准编码,也有另一种方法在PDF中完成字距调整文本:

instead of Hello because of (2). And then there's the other way kerned text is done in PDF, even if standard encoding is used:

[(H)120(e)80(l)95(l)95(o )] TJ

[(H) 120 (e) 80 (l) 95 (l) 95 (o)] TJ

可能,但非常困难,需要编程,但仍然无法解决(3)(这需要位图文本的OCR)。

It might be possible, but very difficult, and would require programming, and still would not address (3) (that would require OCR of the bitmapped text).

这篇关于如何使用命令行在Windows中突出显示PDF中的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆