[译]扫描到PDF
By robot-v1.0
本文链接 https://www.kyfws.com/applications/scan2pdf-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 5 分钟阅读 - 2163 个词 阅读量 0[译]扫描到PDF
原文地址:https://www.codeproject.com/Articles/10140/Scan2PDF
原文作者:A. Riazi
译文由本站 robot-v1.0 翻译
前言
A utility for bulk scanning, converting the scanned pages to PDF and burning them on CD/DVD for archiving.
用于批量扫描,将扫描的页面转换为PDF并将其刻录到CD/DVD上进行归档的实用程序.
- 下载PDFLib库-5,966.4 KB(Download PDFLib library - 5,966.4 KB)
- 下载NeroSDK-3,661.0 KB(Download NeroSDK - 3,661.0 KB)
- 下载源文件-1.14 MB(Download source files - 1.14 MB)
- 下载演示项目-845 KB(Download demo project - 845 KB)
介绍(Introduction)
几个月前,我的一位客户要求我为他的批量扫描过程创建一个简单的实用程序.他还想将扫描的文档保存为PDF,然后将它们刻录到CD/DVD上进行存档.(Several months ago, one of my clients asked me for creating a simple utility for his bulk scanning process. Also he wanted to save the scanned documents into PDF and then burn them on CD/DVD for archiving.)
在网上进行了一些研究之后,我决定结合使用各种免费和开源库.以下是它们的列表:(After some research on the Net, I decided to combine various free and open source libraries. Here is list of them:)
- PDFLib Lite(PDFLib Lite) 版.(version.)请仔细阅读许可证.您只能将该库用于个人用途,不能用于商业用途.(Please read the license carefully. You can use the library for personal usage only, not commercial.)
- Nero Burning CD/DVD SDK/API(Nero Burning CD/DVD SDK/API) .(.)请仔细阅读许可证.(Please read the license carefully.)
- CxImage(CxImage) 成像工具包.谢谢(lmaging toolkit. Thanks to) 戴维`皮佐拉托(Davide Pizzolato)(Davide Pizzolato) 分享他的知识和努力.(for sharing his knowledge and efforts.)
- TWAIN C ++包装器(TWAIN C++ wrapper) .谢谢(. Thanks to) 拉吉夫`拉马尚德兰(Rajiv Ramachandran)(Rajiv Ramachandran) 为他的文章.(for his article.)
Scan2PDF应用程序(Scan2PDF Application)
该程序非常易于使用.我创建了一个向导样式的应用程序,任何人都可以很轻松地使用它.大部分任务将由程序本身完成,并且用户仅设置配置.上图显示了向导的第一个屏幕.(The program is very simple to use. I created a wizard style application that anyone can work with it very easily. Most of the task will be done by program itself and the user only sets the configuration. The above figure shows the first screen of the wizard.)
向导的第二个屏幕要求用户输入项目名称.该应用程序应扫描大量图像,将扫描的图像转换为PDF,然后刻录CD/DVD中的所有PDF.但是,如果在扫描/转换过程中,用户决定离开办公桌,将会发生什么情况.向导解决了这个问题.只需扫描文档,将其保存为PDF,然后就可以保存项目(转到向导的最后一页,然后单击"完成").返回后,您可以打开以前保存的项目.向导第二页的组合框显示所有项目.有关更多信息,请参见图2.(The second screen of wizard asks the user for entering a project name. The application should scan bulk of images, converts scanned images to PDF then burn all PDFs in CD/DVD. However if in middle of scanning/converting process, user decides to leave his desk, what happens. The wizard solves this. Just scan your documents, save them into PDF and whenever you want, you can save your project (going to last page of wizard and click on Finish). After returning, you can open your previous saved projects. The combo box of second page of wizard shows all of projects. See figure 2 for more information.)
这不是有关如何创建此类应用程序的教程.但是您可以看一下源代码并自己学习.也都(This is not a tutorial of how to create such kind of this application. But you can take a look at source code and learn by yourself. Also both) PDF库(PDFLib) 和(and) Nero SDK(Nero SDK) 有关如何使用库的大量文档.对于如何使用有一些想法(have an extensive documentation on how to use the libraries. For having some idea of how you can use) PDF库(PDFLib) ,我的另一篇文章(, my other article) 文字2PDF(Text2PDF) 是另一个很好的起点.(is another good starting point.)
好,我用(OK, I use) CxImage(CxImage) 即时创建TIFF文件的库.您可以修改代码以创建JPEG文件(PDFLib支持两种格式).为了进行扫描,我使用(library for creating TIFF files on the fly. You can modify the code to create JPEG files (the PDFLib supports both formats). For scanning purposes, I use the) C ++ TWAIN包装器(C++ TWAIN wrapper) 撰写者(written by) 拉吉夫(Rajiv) .这两篇文章都提供了有关如何使用代码的良好示例.(. Both of articles have good examples of how to employ the code.)
只需选择您的扫描仪源,单击"扫描新文档",经过几次扫描将所有扫描的文档转换为PDF,然后单击"转换为PDF"按钮.进度条将显示转换进度.创建PDF后,通过单击"扫描新文档",然后单击"转换为PDF",您将拥有单独的PDF文件.(Just select your scanner source, click on “Scan New Documents” and after several scans to convert all the scanned documents into PDF, click on “Convert To PDF” button. The progress bar will show progress of converting. After creating the PDF, by clicking on “Scan New Documents” and then “Convert To PDF”, you will have separate PDF file.)
如果您想知道您扫描了哪些文档,只需单击"扫描的文档".将出现一个对话框,并显示PDF列表.(If you want to know which documents were scanned by you, just click on “Scanned Documents”. A dialog will be appear and shows list of PDFs.)
图4显示了向导的下一步.组合框显示了可用CD驱动器的列表,包括CD刻录机.您可以选择刻录CD或模拟刻录过程.如果要创建CD映像(例如ISO),我已经为您编写了一些代码,但已对其进行了注释.您可以取消注释代码,并创建自己的扫描的/PDF文档的CD图像.(Figure 4 shows the next step of wizard. The combo box shows list of available CD Drives including your CD Burner. You have the option for burning the CD or simulate the burning process. If you want to create an image of CD (such as ISO), I have written some code for you, but commented it. You can uncomment the codes and create your own CD image of scanned/PDF documents.)
最后一步非常易于使用.您有两个选择.如图5所示,一个用于再次启动该向导以用于另一个向导,另一个用于删除当前项目(及其PDF).(The last step is very simple to use. You have two options. One for launching the wizard again for another wizard and one for deleting the current project (and its PDFs) as shown in Figure 5.)
我希望该实用程序对某人有用,也让许多人可以从它或其源代码中受益.(I hope this utility becomes useful for someone and also many people can benefits from it or its source code.)
请享用!(Enjoy!)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VB6 C++ VB VC6 Windows .NET Win2K MFC Visual-Studio Dev 新闻 翻译