From dev-return-65394-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Tue Sep 17 15:51:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7DECC180645 for ; Tue, 17 Sep 2019 17:51:04 +0200 (CEST) Received: (qmail 44956 invoked by uid 500); 17 Sep 2019 15:51:03 -0000 Mailing-List: contact dev-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list dev@pdfbox.apache.org Received: (qmail 44852 invoked by uid 99); 17 Sep 2019 15:51:03 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2019 15:51:03 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 79C36E3149 for ; Tue, 17 Sep 2019 15:51:02 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id D641B78090B for ; Tue, 17 Sep 2019 15:51:00 +0000 (UTC) Date: Tue, 17 Sep 2019 15:51:00 +0000 (UTC) From: =?utf-8?Q?Andreas_Lehmk=C3=BChler_=28Jira=29?= To: dev@pdfbox.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Issue Comment Deleted] (PDFBOX-2116) Compare tow pdf file and hilight the mismatch value in generated pdf file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PDFBOX-2116?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Lehmk=C3=BChler updated PDFBOX-2116: --------------------------------------- Comment: was deleted (was: Zeonpad provides the free java api to compare two PDF files and gener= ates pdf which contain highlighted value of mismatch after comparing two pd= f. its based on PDFBOX api. [http://www.zeonpad.com/app/index.html] =C2=A0 Example : {{ZPDFCompare obj =3D new ZPDFCompare(); }} {{obj.pdfcompare("C:\\Users\\Desktop\\expectedFile.pdf", "C:\\Users\\Deskto= p\\actualFile.pdf", "C:\\Users\\Desktop\\expectedFile_Diff.pdf","C:\\Users\= \tarun.kumar\\Desktop\\actualFile_Diff.pdf");}}) > Compare tow pdf file and hilight the mismatch value in generated pdf file= =20 > -------------------------------------------------------------------------= - > > Key: PDFBOX-2116 > URL: https://issues.apache.org/jira/browse/PDFBOX-2116 > Project: PDFBox > Issue Type: Task > Components: PDModel > Affects Versions: 1.8.5 > Environment: Java Environment using PDF box > Reporter: Amit Vishwakarma > Priority: Major > Labels: test > Original Estimate: 12h > Remaining Estimate: 12h > > {code} > =09=09PDDocument doc=3D PDDocument.load(pdf1); > =09=09PDDocument doc2=3D PDDocument.load(pdf2); > =09=09 > =09=09System.out.println(doc); > =09=09 > =09=09@SuppressWarnings("rawtypes") > =09=09List list=3Ddoc.getDocumentCatalog().getAllPages(); > =09=09@SuppressWarnings("rawtypes") > =09=09List list2=3Ddoc2.getDocumentCatalog().getAllPages(); > =09=09 > =09=09PDFTextStripper stripper=3Dnew PDFTextStripper(); > =09=09PDFTextStripper stripper2=3Dnew PDFTextStripper(); > =09=09 > =09=09String pages=3D null; > =09=09String pages2=3D null; > =09=09 > =09=09System.out.println("list1 size : "+list.size()); > =09=09System.out.println("list2 size : "+list2.size()); > =09=09 > =09=09if(list.size()=3D=3Dlist2.size()){ > =09=09=09 > =09=09=09for(int i=3D1;i<=3Dlist.size();i++){ > =09=09=09=09stripper.setStartPage(i); > =09=09=09=09stripper.setEndPage(i); > =09=09=09=09 > =09=09=09=09stripper2.setStartPage(i); > =09=09=09=09stripper2.setEndPage(i); > =09=09=09=09 > //=09=09=09=09System.out.println("-----------"+stripper.getEndPage()); > =09=09=09=09 > =09=09=09=09pages =3D stripper.getText(doc); > =09=09=09=09pages2 =3D stripper2.getText(doc2); > =09=09=09=09 > =09=09=09=09String lines[] =3D pages.split("\\r?\\n"); > =09=09=09=09String lines2[] =3D pages2.split("\\r?\\n"); > =09=09=09=09 > =09=09=09=09System.out.println("Line in first page : "+lines.length); > =09=09=09=09System.out.println("Line in second page : "+lines2.length); > =09=09=09=09 > =09=09=09=09if(lines.length=3D=3Dlines2.length){ > =09=09=09=09=09 > =09=09=09=09=09for(int a=3D0;a //=09=09=09=09=09=09System.out.println(lines[a]); > //=09=09=09=09=09=09System.out.println("************----------**********"= ); > =09=09=09=09=09=09String cols[] =3D lines[a].split("\\s+"); > =09=09=09=09=09=09String cols2[] =3D lines2[a].split("\\s+"); > =09=09=09=09=09=09if(cols.length=3D=3Dcols2.length){ > =09=09=09=09=09=09=09for(int b=3D0;b =09=09=09=09=09=09=09=09//System.out.println(cols[b].toString()+" - - - -= "+cols2[b].toString()); > =09=09=09=09=09=09=09=09//System.out.println("Page : "+i+" Row : "+a+" Co= lumn : "+b); > =09=09=09=09=09=09=09=09if(!cols[b].toString().equalsIgnoreCase(cols2[b].= toString())){ > =09=09=09=09=09=09=09=09=09System.out.println("Not matched : "+cols2[b].t= oString()); > =09=09=09=09=09=09=09=09=09//System.out.println("Page : "+i+" Row : "+a+"= Column : "+b); > =09=09=09=09=09=09=09=09} > =09=09=09=09=09=09=09=09 > =09=09=09=09=09=09=09} > =09=09=09=09=09=09}else{ > =09=09=09=09=09=09=09System.out.println("column are not equals"); > =09=09=09=09=09=09} > =09=09=09=09=09} > =09=09=09=09=09System.out.println("******"); > =09=09=09=09}else{ > =09=09=09=09=09System.out.println("Line are not equal "); > =09=09=09=09} > =09=09=09=09 > =09=09=09} > =09=09}else{ > =09=09=09System.out.println("Page size is not equal"); > =09=09} > =09=09 > =09=09 > =09 doc.close(); > {code} -- This message was sent by Atlassian Jira (v8.3.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org For additional commands, e-mail: dev-help@pdfbox.apache.org