基于Web的2个pdf文档比较应用程序 [英] Web based application for comparasion of 2 pdf documents

查看:138
本文介绍了基于Web的2个pdf文档比较应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要将一个新功能集成到现有的Java Web应用程序中,该功能允许用户比较2个pdf文档并查看差异.因此,我开始搜索一些已经存在的库或工具(开放源代码或商业工具),可以帮助我解决该请求. 有谁知道是否存在这种应用程序?那将需要2个pdf,进行比较并显示差异?

We need to integrate into an existing java web application, a new feature that allows the user to compare 2 pdf documents and see the differences. So, I started to search for some already exiting library or tool (open source or commercial) that could help me solve this request. Does anyone know if exists this kind of application? That would take 2 pdf, compare them and display the differences?

预先感谢, 马达莉娜

推荐答案

您好,我做了一个基于PDFBOX的PDF比较项目,您可以从

Hello i made a PDF comparision project built on PDFBOX you can donwload source code from link

示例用法在下面提到,它执行三个级别的比较,您可以简单地通过将目标文件和源文件名保存在列表中,然后调用其比较功能来添加循环.

Example Usage is mentioned below it performs three levels of comparison you can simply add a loop by saving target and source files name in a list and then calling its comparison functionalities .

        pdfComparison cmp=new pdfComparison();
      //Text Comparision page by page         if(cmp.textComparision("ReferencePDF\\PDF2_302.pdf","C:\\\PDF2_305.pdf"))
              {
        System.out.print("\n********PDF text is identical******* ");

              }
              else 
              {
                  System.out.print("\n********PDF text is  not identical******* ");

              }

//Extract all images in PDF and compare   
    cmp.extract_ALL_Images_ThenCompare("PDF2_302.pdf","PDF2_302.pdf");

//Convert Both PDF pages into JPG and perform image comparison 
        cmp.PDF_Convert_To_Jpeg_Comparision("PDF2_302.pdf","PDF2_302.pdf");

您将在项目的文件夹差异中看到所有图像差异.如果有任何问题,请给我留言

You will see all image differences in folder Differences in the project . If any issue just put a message for me

这篇关于基于Web的2个pdf文档比较应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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