itext怎么复制粘贴的快捷键贴

有了 iText:你截图,腾讯、Google OCR 帮你识别文字 [送码] - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
已注册用户请 &
爱意满满的作品展示区。
有了 iText:你截图,腾讯、Google OCR 帮你识别文字 [送码]
· 262 天前 · 9203 次点击
比如,在看类似上面的扫描版 PDF 时,想要复制其中的文字,怎么办?手打?太累。试试我新开发的工具
iText 是 macOS 平台的 OCR 工具,自带截图功能,选择屏幕任意区域,即可识别其中的文字,又爽又酷。
识别后的文字已经复制到系统剪贴板,直接粘贴即可。
配合 ??1 快捷键,使用体验更佳。当然,你也可以选择图片文件,或者将图片拖拽至 iText 的菜单栏图标进行识别。
文字识别精准
你有没有这种印象:OCR 识别出来的文字有很多问题,还不如自己打字来得快。可见,识别的准确性非常重要,也是我非常在意的一点。
2.1. 腾讯、Google 双引擎
首先,我排除了离线的识别库,因为离线注定了这些库的识别能力是死的,不会自己增强。接下来,在一票在线 OCR 服务中,我对比了百度、腾讯、微软、Google 等大厂的产品,最后选择了国内使用腾讯、国外使用 Google 的组合。判断依据是什么?少量测试 + 主观倾向,比如不测我就觉得 Google 比微软牛。
那么,到底识别准不准呢?这么说吧:
对于一般的自然语言,比如书中的一段话、新闻稿,识别效果是惊人的准确,甚至可以达到 100%
对于排版复杂、尤其有特殊字符的文字,比如程序代码、选择题,识别效果就不太理想,需要手动对识别后的结果进行修正
比如,单纯地给一个竖线,机器是无法区分到底是小写的 l、还是大写的 I (顺便问一下,你看出二者的区别了吗?);与之相对,机器是需要根据上下文进行判断和优化的。而像程序代码这种非自然语言,机器目前是很难进行语义识别的
到底准不准?你不妨一试。
2.2. 独创算法,进一步优化识别结果
OCR 服务还有一些欠缺,iText 针对性地做了这些优化:
自动识别段落
中文环境使用全角标点符号
中文与英文字母、数字间增加空格
删除中文字符间、英文字符与标点符号间的多余空格
英文首字母大写
如果你发现识别不好的地方,欢迎把图发给我,我会相应地优化算法,毕竟算法是需要数据喂养的,先谢。
2.2. 预览原图,方便校对
在目前 OCR 技术不能始终达到 100% 的情况下,预览原图、并进行修正,还是有必要的。在 iText 中,你可以这样:
将识别后的窗口拖到图片附近
调用 iText 识别结果的 双栏模式:左侧展示图片、右侧展示识别后的文字
这样,就可以很方便地对照原图进行手动优化识别后的文字。
3. 下载与付费
其实,很多场景都会用到 iText,比如 识别快递单上的号码、图片中的联系人信息、需要登录才能复制的网页 等等,欢迎下载 iText 试试。
每月可免费识别 20 次,订阅 iText 高级版即可无限次识别。首发期间,高级版限时 6 折优惠:¥ 3/月、¥ 30/年。关于收费模式,我很是纠结了一番。如果你准备吐槽,请先看下这篇文章:
V 友专属福利:iText Pro 一年期兑换码:
JAY9T73KR4TP
TFA6KWKTRW4E
KY639HYMWMPH
T6LRJ77HR7JT
HFJMKT39J6F7
手慢无;兑换后,最好在这里留言说明哪个已经用了,节约其他 V 友时间。
如果你觉得 iText 还不错,还请帮忙 ;如果你觉得 iText 还可以改进,欢迎:
微信加小号入群:it_guwen
82 回复 &| &直到
08:44:38 +08:00
& &262 天前 via iPhone
好顶赞,感觉近期用不上所以码就不领了,留给后来的同学
& &262 天前
& &262 天前 via Android
路过帮顶,这软件看着很牛逼,不过我暂时用不上。兑换码就留给楼下吧。
& &262 天前
感谢分享!HFJMKT39J6F7已用。
& &262 天前 via Android
没有 window 版本
& &262 天前
T6LRJ77HR7JT 已用,感谢!
& &262 天前
为什么美区价格依然 0.99/m;9.99/y.
& &262 天前
这款软件看起来很棒,留给急需的同学
& &262 天前 via iPhone
码不领了,帮赞
& &262 天前
不支持 windows 就是耍流氓。。。
& &262 天前
JAY9T73KR4TP,已用,感谢
& &262 天前
TFA6KWKTRW4E 已用。感谢楼主?
& &262 天前
@ 咦,奇怪,我 28 小时前就在 iTunes 后台改过价格了,现在还没更新?可能是时差问题,美国时间还没到 30 号,可以再等等。
& &262 天前
JAY9T73KR4TP 已用,谢谢
& &262 天前
& &262 天前 via Android
真的是优化了算法吗,还是对 ocr 接口返回的结果简单的进行了中文版式优化。要我都不敢把这种小儿科的东西发出来?
& &262 天前
试了一下确实很不错
& &262 天前
@ 没事,你发出来吧。
& &262 天前
@ 谢谢肯定 ?
& &262 天前
已买,感觉是不错的软件。谢谢作者。价格已经很便宜了,给你点赞。希望开发出更好的工具。记得好像把 iPic, iPaste 都买了。
& &262 天前
@ 谢谢肯定,我一直在坚持,iText 已经是第 7 款 macOS App 了?
& &262 天前
试用了下,不错,赞一个
& &262 天前
@ 谢谢,努力得到肯定,开心 ?
& &262 天前
很不错, 赞一个
& &262 天前
挺方便的。
& &262 天前 via iPhone
谷歌大法好!上次用谷歌的翻译 api 翻译了一个 5400 行 9 列的表格,那速度和质量灰常好!
& &262 天前
赞,试用一段时间看看。
& &262 天前 via Android
能对比下 Google 和微软的识别效果吗。微软必应的翻译 API 质量是显然高于谷歌的。不知道 OCR 是否也是如此。
& &262 天前 via iPhone
建议是可以采用多种付费方式,一天用 100 次,包月不亏,装上去留着备用,一个月都不见得能用几次。
& &262 天前
KY639HYMWMPH 已用
& &262 天前
& &262 天前
@ @ @ 谢谢支持。
& &262 天前
iText 跟那个处理 pdf 的软件不是重名了吗
& &262 天前
@ 并不能。因为如果提供客观公正的结论,要做大量的测试,我做不到,不能随便下结论;并且,云服务是在不断变化的。不过,你提供一张具体的图,我是可以给出二者的识别结果的。
& &262 天前
已设为开机启动
& &262 天前
@ 「装上去留着备用,一个月都不见得能用几次。」 iText 默认每月可免费识别 20 次,像你说的够用了。
& &262 天前
@ 不管,我就喜欢 ? 主要是跟我 i 系列的名字一致。要起个好的、又全球唯一的名字,几乎不可能。
& &262 天前
@ 最实在的支持 ?
& &262 天前 via Android
想入手 可惜没有 mac
& &262 天前
wri t e wh i 1 ea, b=0,1-----------逗号会识别成中文全角的情况
& &262 天前
@ 你是尝试识别程序代码吗?文中有提,这种情况识别不好。对于自然语言比较好些。
& &262 天前
支持楼主, 现在
Mac 开发人员感觉还是很少啊
& &262 天前
@ 跟 iOS 没法比,目测 1% 不到。
& &262 天前
有没有 iOS 版
& &262 天前
@ 没; iOS 其实有很多选择,比如「白描」
& &262 天前
& &262 天前
支持独立开发者。话说,老哥你除了 v 站,在别的地方有推你的应用吗?只靠 v 站网友应该养不活自己吧?
& &262 天前
@ 微博、知乎等等吧,你觉得还在哪推荐比较好呢?
& &262 天前
什么时候出 windows 版
& &262 天前
订阅支持下你
& &262 天前
@ 抱歉,短期无计划。
& &262 天前
iText 名字也忒不符了。。。还不如叫 iOCR。。。既然使用了第三方库,很好奇这些库的授权协议是什么。。。在线上传的话,隐私性会很有问题。。。都是公司文件截图、发票截图之类的。。。基本上不敢这么用。另外,我个人觉得一个 chrome extension 就能搞定的事情,非要弄个订阅。。。这种小型工具就应该一次性付费。。。最后的最后,兑换码也忒抠了,虽然我不用,但是你可以看看其它 在这里发布 app 的作者,他们的兑换码有多少个。。。
& &262 天前
@ 谢谢老铁 ?
& &262 天前
@ 名字偏好各有所好。隐私协议可见于腾讯和 Google 的声明。关于付费,请参见文末的介绍及链接。期待你的 Chrome Extension。对,我很抠。
& &262 天前
顶一个,用过楼主的 iPic,很好用能否借地问楼主一个问题,macOS 开发零基础,我想做个工具自己用,具体只有两个需求(都是 BetterTouchTool 里的功能)1. 三个手指 click trackpads,触发 win+w (也就是关闭)2. 两个手指,一个手指按住,另一个轻点,触发另一个快捷键先谢过了
& &262 天前 via Android
@ 楼主调用识别接口也是要付费的。公司业务肯定不方便使用,楼主这个主要也是 to C 的吧
& &262 天前
@ 兑换码用完了??
& &262 天前
@ 我没有这部分直接的开发经验哎,看看 NSEvent 相关的介绍吧。
& &262 天前
@ 感谢,你说了公道话。
& &262 天前
@ 上面的回复一看便知。
& &262 天前
工具非常好用 价格还这么低
& &262 天前
識別不了日語呢 = = 提供例子: ありがとう
& &262 天前
@ 原来如此,感谢告知~@ 我不会 chrome extension,我只是认为没必要单独做一个 app,正如你认为有必要做一样。只是很反感还是订阅,尤其是纯工具类的。。。话说,从你的文章就能看出‘‘我是独立开发者,我很不容易,所以花你点钱用订阅制,能支撑我继续独立开发者’’这种味道。。。独立开发者做的 app 就应该是订阅制吗?这跟创业型公司 = 加班 岂不是一个道理?说话直,别见怪,只是看不惯这些乱七八糟的怪现象。。。
& &262 天前
@ 终端运行下面的命令,强制使用 Google ;之后会在菜单中提供入口。defaults write ~/Library/Containers/net.toolinbox.iText/Data/Library/Preferences/net.toolinbox.iText.plist OCRService "Google"
& &262 天前
@ 还是先看下我文末关于付费模式的思考吧。「从你的文章就能看出」,我并不能理解你推理的逻辑;你得到的苦情结论,是你想得出的结论。比如,你看看#61 楼的回复,并不是每个人都有相同的理解。
& &262 天前
@ 懂了。。。。。
& &262 天前
& &262 天前
& &261 天前
作者的各种作品,需求把握得都很到位。
& &261 天前
@ 其实也有无心插柳的成分;我正在写 iText 从头开始的完整经历,下周会在 GitChat 上发。
& &261 天前
艺高心细日常帮顶
& &261 天前
@ 谢谢支持 ?
& &261 天前
iPic 一年后的续费价格让我离开。这次目测也是。
& &260 天前
菜单栏图标太丑
& &259 天前
& &257 天前
开源替代品
& &257 天前
@ 既然你提了,我扔 2 张图,你试试段落识别吧。其他的细节和优化,我就不提了。
以及我在做段落识别时的一些素材:
& &256 天前
@ 哈哈楼主自己说了他是奸商
& &255 天前
楼主,我又来请教了 ... 想入门 macOS 开发,网上搜了下资料好少,有没有推荐的网站或者书籍或者简单的 demo ? swift 语言楼主能不能分享下自己的入门经验呢 ... 跪谢
& &254 天前
@ 我之前写过这篇文章:Mac 开发的神秘面纱:后娘养的嫡长子
& &254 天前
@ 您推荐的那本书是只有英文版的嘛?
& &254 天前
@ 我看的是英文版,中文版没了解过。
& · & 1855 人在线 & 最高记录 3762 & · &
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.1 · 25ms · UTC 11:17 · PVG 19:17 · LAX 04:17 · JFK 07:17? Do have faith in what you're doing.iText PDF, easy PDF generation for Java or .NET developers | iText
Our software productsiText 7 Suite
iText 7 Community
For developers who wish to share their entire application source code with the open-source community as free software under the AGPL “copyleft” terms.
iText 7 Core
If you want to use iText in a closed source, proprietary environment, you have to purchase an iText commercial license.
You can also extend iText 7 Core with iText 7 add-ons.
An iText 7 add-on.
Remove content from your PDF files quickly and efficiently.
pdfInvoice
An iText 7 add-on.
Automate your invoices with PDF technology that's compliant with the ZUGFeRD standard.
An iText 7 add-on.
Access the world's only tool for debugging PDF syntax in real-time, integrated within your developer environment!
pdfCalligraph
An iText 7 add-on.
Achieve the right ligatures, calligraphy and type-setting for special and non-Latin script types (e.g. Arabic and Devanagari).
An iText 7 add-on.
Flatten dynamic forms, and secure your data.
An iText 7 add-on.
Convert HTML and CSS to PDF, with ease.
An iText 7 add-on.
Extract data from your PDF documents, programmatically.
The iText Developer Platform
Have you ever wanted to make money from your application development? We can help.
The iText developer platform is now available for third party add-ons. This means that we are looking for development partners who want to build and create iText 7 add-ons, but want to leave marketing and sales to the professionals. We sell your add-on as an iText product, and you get revenue sharing for every sale we make.
Sounds interesting?
Why choose iText?
Create document applications faster with the best programming module.
Your PDFs will be produced in less time. With the iText API you can create a PDF with only 5 additional lines of code!
You get one of the best-documented and most versatile PDF engines in the world (written in Java and .NET). We offer free eBooks, tutorials, and examples.
Integrate PDF functionalities within your applications, processes or products. With the release of iText 7 Suite, you can optimize invoicing, ensure long-term archiving, take care of compliance issues through a PDF SDK, create your PDFs with more elegant typography, safeguard your intellectual property, and much more.
Get direct access to our support staff on three continents.
A proven and award winning solution partner in automating document processes. We have been passionate about delivering better automated document processes for over 15 years. With us, you can truly take your documentation needs to the next level. iText serves over 5,000 customers across the globe, including finance, government, technology and logistics companies.
Our key features
Create and convert documents from XML, HTML, web forms, CSS or databases to PDF and make them compliant with worldwide standards.
Fill out and flatten interactive forms (AcroForm and XFA), add interactivity and allow digital signatures and invoices to optimize your workflow and reduce your paper stack.
Split or merge documents, copy, import or tile pages or enrich structure and redact content such as barcodes, watermarks and stamps.
Turn your archives into neatly organized and compliant data that can even be read by users with visual impairments.
Our customers
TECHNOLOGYFINANCEINSURANCE
Our mission
To continue to innovate ways to make our users and customers lives simpler by offering digital transformation options to make PDF processes smoother, faster and more automated. For our customers, offering rapid support to optimize your customer experience.
Our vision
We want to enable the paperless world pushing the limits of digital document interactivity.
Our values
Open-Source
Collaborative innovation
Rewarding hard work and dedication
Questions? Contact us
Thank you for your interest in iText.
We will contact you within one business day.PdfCopyFields.java_Java PDF文件读取与编辑制作类库iText_类库组件_新兴源码下载
当前位置: >
> PdfCopyFields.java
Java-iText-5.0.4.rarsrcrupscomitextpdfrupsviewmodelsitexttreenodesiconsmodeliofilterscontrollercorecomitextpdftextxmlxmpsimpleparserpdfrichmediaqrcodeparserinternalinterfaceshyphenationfontscmapseventsdrawcryptocollectioncodecwmfhtmlsimpleparserfactoriesexceptionserror_messagesant
loading...
* $Id: PdfCopyFields.java -02 23:22:20Z xlv $
* This file is part of the iText project.
* Copyright (c) T3XT BVBA
* Authors: Bruno Lowagie, Paulo Soares, et al.
* This prog you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License version 3
* as published by the Free Software Foundation with the addition of the
* following permission added to Section 15 as permitted in Section 7(a):
* FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY 1T3XT,
* 1T3XT DISCLAIMS THE WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* alo if not, see http://www.gnu.org/licenses or write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA,
USA, or download the license from the following URL:
* http://itextpdf.com/terms-of-use/
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License.
* In accordance with Section 7(b) of the GNU Affero General Public License,
* you must retain the producer line in every PDF that is created or manipulated
* using iText.
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial activities involving the iText software without
* disclosing the source code of your own applications.
* These activities include: offering paid services to customers as an ASP,
* serving PDFs on the fly in a web application, shipping iText with a closed
* source product.
* For more information, please contact iText Software Corp. at this
* address:
package com.itextpdf.text.
import java.io.IOE
import java.io.OutputS
import java.security.cert.C
import java.util.HashM
import java.util.L
import com.itextpdf.text.DocW
import com.itextpdf.text.DocumentE
import com.itextpdf.text.pdf.interfaces.PdfEncryptionS
import com.itextpdf.text.pdf.interfaces.PdfViewerP
* Concatenates PDF documents including form fields. The rules for the form field
* concatenation are the same as in Acrobat. All the documents are kept in memory unlike
* PdfCopy.
Paulo Soares
public class PdfCopyFields
implements PdfViewerPreferences, PdfEncryptionSettings {
private PdfCopyFieldsI
* Creates a new instance.
* @param os the output stream
* @throws DocumentException on error
public PdfCopyFields(OutputStream os) throws DocumentException {
fc = new PdfCopyFieldsImp(os);
* Creates a new instance.
* @param os the output stream
* @param pdfVersion the pdf version the output will have
* @throws DocumentException on error
public PdfCopyFields(OutputStream os, char pdfVersion) throws DocumentException {
fc = new PdfCopyFieldsImp(os, pdfVersion);
* Concatenates a PDF document.
* @param reader the PDF document
* @throws DocumentException on error
public void addDocument(PdfReader reader) throws DocumentException, IOException {
fc.addDocument(reader);
* Concatenates a PDF document selecting the pages to keep. The pages are described as a
* &CODE&List&/CODE& of &CODE&Integer&/CODE&. The page ordering can be changed but
* no page repetitions are allowed.
* @param reader the PDF document
* @param pagesToKeep the pages to keep
* @throws DocumentException on error
public void addDocument(PdfReader reader, List&Integer& pagesToKeep) throws DocumentException, IOException {
fc.addDocument(reader, pagesToKeep);
* Concatenates a PDF document selecting the pages to keep. The pages are described as
* ranges. The page ordering can be changed but
* no page repetitions are allowed.
* @param reader the PDF document
* @param ranges the comma separated ranges as described in {@link SequenceList}
* @throws DocumentException on error
public void addDocument(PdfReader reader, String ranges) throws DocumentException, IOException {
fc.addDocument(reader, SequenceList.expand(ranges, reader.getNumberOfPages()));
/** Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
* @param userPassword the user password. Can be null or empty
* @param ownerPassword the owner password. Can be null or empty
* @param permissions the user permissions
* @param strength128Bits &code&true&/code& for 128 bit key length, &code&false&/code& for 40 bit key length
* @throws DocumentException if the document is already open
public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits) throws DocumentException {
fc.setEncryption(userPassword, ownerPassword, permissions, strength128Bits ? PdfWriter.STANDARD_ENCRYPTION_128 : PdfWriter.STANDARD_ENCRYPTION_40);
* Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
* @param strength true for 128 bit key length. false for 40 bit key length
* @param userPassword the user password. Can be null or empty
* @param ownerPassword the owner password. Can be null or empty
* @param permissions the user permissions
* @throws DocumentException if the document is already open
public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException {
setEncryption(DocWriter.getISOBytes(userPassword), DocWriter.getISOBytes(ownerPassword), permissions, strength);
* Closes the output document.
public void close() {
fc.close();
* Opens the document. This is usually not needed as addDocument() will do it
* automatically.
public void open() {
fc.openDoc();
* Adds JavaScript to the global document
* @param js the JavaScript
public void addJavaScript(String js) {
fc.addJavaScript(js, !PdfEncodings.isPdfDocEncoding(js));
* Sets the bookmarks. The list structure is defined in
* &CODE&SimpleBookmark#&/CODE&.
* @param outlines the bookmarks or &CODE&null&/CODE& to remove any
public void setOutlines(List&HashMap&String, Object&& outlines) {
fc.setOutlines(outlines);
/** Gets the underlying PdfWriter.
* @return the underlying PdfWriter
public PdfWriter getWriter() {
* Gets the 1.5 compression status.
* @return &code&true&/code& if the 1.5 compression is on
public boolean isFullCompression() {
return fc.isFullCompression();
* Sets the document's compression to the new 1.5 mode with object streams and xref
* streams. It can be set at any time but once set it can't be unset.
* If set before opening the document it will also set the pdf version to 1.5.
public void setFullCompression() {
fc.setFullCompression();
* @see com.itextpdf.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(byte[], byte[], int, int)
public void setEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType) throws DocumentException {
fc.setEncryption(userPassword, ownerPassword, permissions, encryptionType);
* @see com.itextpdf.text.pdf.interfaces.PdfViewerPreferences#addViewerPreference(com.itextpdf.text.pdf.PdfName, com.itextpdf.text.pdf.PdfObject)
public void addViewerPreference(PdfName key, PdfObject value) {
fc.addViewerPreference(key, value);
* @see com.itextpdf.text.pdf.interfaces.PdfViewerPreferences#setViewerPreferences(int)
public void setViewerPreferences(int preferences) {
fc.setViewerPreferences(preferences);
* @see com.itextpdf.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(java.security.cert.Certificate[], int[], int)
public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException {
fc.setEncryption(certs, permissions, encryptionType);
| Copyright &
. All Rights Reserved .

我要回帖

更多关于 苹果电脑怎么复制粘贴 的文章

 

随机推荐