Automating the process of comparing two PDF file with the help of QTP(Automation Testing Tool)
Can anybody help me with comparing the two pdf files with the help of QTP.I have Adobe Acrobat installed on my system and i have access to the API.
Thanks,
Varun Saini
I want to find out more about QTP and API. Maybe that is what I want to compare two mechanical drawings for differences between them. (see “More than one pdf file in one window”. Is that what you are looking to do? 9Not necessarily mechanical drawings but some other pdf).
Similar Messages
-
Compare two pdf files using adobe acrobat through command line
Does anyone know how to compare two pdf files using adobe acrobat through command line. I want to do this via command line because we want to compare hundreds of file every day through some automated windows tasks.
If command line option is not available in acrobat, then is it feasible to make use of acrobat javascript API to do this task?
Any kind of help will be greatly.Command-line: Not possible.
JavaScript: Possible, but very limited. Basically the only thing you can do is simulate clicking the Compare Documents button. The rest has to be done manually.
However, it *might* be possible to automate this process a bit more using a plugin. Ask over at the Acrobat SDK forum for more information... -
How to compare two PDF files through PLSQL
Hi,
Can any body help that how to compare two PDF files through PLSQL programing and gives the differences as output.
Thanks,Or simply apply an oracle text index on your pdf column:
SQL> create table t (id integer primary key, bl blob)
Table created.
SQL> declare
bf bfile := bfilename('TEMP','b32001.pdf');
bl blob;
begin
dbms_lob.createtemporary(bl,true);
dbms_lob.open(bf,dbms_lob.lob_readonly);
DBMS_LOB.LOADFROMFILE(bl, bf,dbms_lob.getlength(bf));
insert into t values (1,bl);
commit;
dbms_lob.close(bf);
dbms_lob.freetemporary(bl);
end;
PL/SQL procedure successfully completed.
SQL> create index t_idx on t (bl) indextype is ctxsys.context parameters ('filter ctxsys.auto_filter')
Index created.
SQL> declare
mklob clob;
begin
ctx_doc.filter ('t_idx', '1', mklob, true);
dbms_output.put_line (substr (mklob, 1, 250));
dbms_lob.freetemporary (mklob);
end;
Oracle® Database
Release Notes
11
g
Release 1 (11.1) for Linux
B32001-04
November 2007
This document contains important information that was not included in the
platform-specific or product-specific documentation
PL/SQL procedure successfully completed.This generates a text only version of your pdf and standard text comparison methods can be applied .... -
Installed Adobe XI Pro trial verison, when compared two pdf files it gives error "Expected a Name Object"..Can some one say how to fix this?
Installed Adobe XI Pro trial verison, when compared two pdf files it gives error "Expected a Name Object"..Can some one say how to fix this?
-
How can i compare two excel files with different no. of records.
Hi
I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
String delims = "[;,\t,,,|]";
String[] tokens = strLine.split(delims);
String[] tokens1 = strLine1.split(delims);
if (tokens.length > tokens1.length)
for (int i = 0; i < tokens.length; i++) {
try {
if (!tokens.equals(tokens1[i])) {
System.out.println(tokens[i] + "<----->" + tokens1[i]);
out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
out.println();
sno++;
} catch (Exception exception)
out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
out.println();
Thanks & RegardsA CSV file is not an Excel file.
But apart from that your logic makes no sense.
If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
That system however is overly complicated for comparing CSV files.
As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines. -
Hi All,
I have compared two pdf files using below method
DigSigCompareWords
(docA, docB, true);
The report will be generated as document A document B where i'm seeing
all the compare words and matched text.
But i need to get the consolidated report like the one i'm getting from adobe acrobat XI professional compare document with text only.
Any help will be appreciated.Thanks Irosenth.
I have another problem i have sucecssfully compare two documents but i couldn't able to save 3rd document if i use activedocument to copy to pddoc and save also its not saving.
Please suggest ideas.
Note:
i have read all the forums releated to this that all the user expect this feature[comparison] as automation from 2010 stil not available in sdk XI,X. -
Hi Guys
I have two csv files with the following headers and I need to import both files into the script to check whether the StaffCode is present in the Creation/Renewal of Contract csv in a DisableAccount Script so I can stop any action to disable the account as
the staff has renewed the contract with the company so the account should not be disabled.
However my accounts are still being disabled. I am not sure now to construct the query so that it detects that the account is to be left alone if the staffcode is present in both files
I does recognize that the $staffcodeN in the renewal file matches the $staffcode in the termination file
but still proceeds to disable or set an expiry date to the account anyway based on the termination file.
How do I stop it from doing that?
1)In the Creation/Renewal of contract file the following headers are present
- TranCode,StaffCode,LastName,FirstName,SocialSecurityNo,DateJoin,Grade,Dept,LastUpdateDate,EffectiveDate
2)In the Disable of contract file the following headers are present
- TranCode,StaffCode,LastName,FirstName,SocialSecurityno,LastDateWorked,Grade,Dept,LastUpdateDate,
My data is not very clean , I have a-lot of special characters such as = , ' ,/ and \ characters to remove first before i can compare the data
Thanks for the help in advance.
Yours Sincrely
Vicki
The following is a short snippet of the code
$opencsv = import-csv "D:\scripts\Termination.csv"
$opencsv2 = import-csv "D:\scripts\RenewContractandNewStaff.csv"
foreach ($usertoaction in $opencsv)
$Trancode = $usertoactionTranCode
$StaffCode = $usertoaction.StaffCode.replace("=","").replace('"','')
$LastName = [string]$usertoaction.LastName.Replace("/","\/").Replace(",","\,")
$FirstName = [string]$usertoaction.FirstName.Replace("/","\/").Replace(",","\,")
$socialsecurityno = $usertoaction.SocialSecurityNo.replace("=","").replace('"','')
$DateJoin = $usertoaction.DateJoin.replace("=","").replace('"','')
$LastDateWorked = $usertoaction.LastDateWorked.replace("=","").replace('"','')
$Grade = [string]$usertoaction.Grade
$Dept = [string]$usertoaction.Dept
$LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
$AccountExpiry = [datetime]::Now.ToString($LastDateWorked)
foreach ($usertoaction2 in $opencsv2)
$TrancodeN = $usertoaction2.TranCode
$StaffCodeN = $usertoaction2.StaffCode.replace("=","").replace('"','')
$socialsecurityNoN= $usertoaction2.SocialSecurityNo.replace("=","").replace('"','')
$DateJoinN = $usertoaction2.DateJoin.replace("=","").replace('"','')
$GradeN = [string]$usertoaction2.Grade
$DeptN = $usertoaction2.Dept
$LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
$EffectiveDate = $usertoaction.EffectiveDate.replace("=","").replace('"','')
$LastName2 = [string]$usertoaction2.LastName.Replace(",", "").Replace("/","").trim()
$FirstName2 = [string]$usertoaction2.FirstName.Replace("/","").trim()
# Use DirectorySearcher to find the DN of the user from the sAMAccountName.
$Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$Root = $Domain.GetDirectoryEntry()
$Searcher = [System.DirectoryServices.DirectorySearcher]$Root
$Searcher.Filter = "(sAMAccountName=$samaccountname)"
$doesuserexist1 = $Searcher.Findall()
if ($doesuserexist1 -eq $Null)
{Write-Host $samaccountname "account does not exist"}
elseif ($StaffCodeN -match $staffcode)
write-host "user has renewed the contract, no action taken"
else
if(($lastupdatedate -ne $null)-or($LastDateWorked -ne $null))
write-host "Setting Account Expiry to"$accountexpirydate
#$ChangeUser.AccountExpires = $accountexpirydate
#$Changeuser.setinfo()
if ($UserMailforwarding -ne $null)
#Set Account expiry date to Last Date Worked
# $ChangeUser.AccountExpires = $accountexpirydate
# $Changeuser.setinfo()
write-host "staff" $displayname "with staff employee no" $samaccountname "has
mailforwarding"
Write-host "Please disable the account manually via Active Directory Users & Computers and
Elseif ($accountexpirydate -lt $todaysdate)
#disable the accountHi Vicki,
This Forum has an insert-codeblock function. Using it will make your script far more readable
Your script is missing some parts, it is impossible to follow the problem.
You are performing the same string cleaning action on $opencsv2 for each element in $opencsv, when doing it once should suffice. Why not start it all by cleaning the values and storing the cleaned values in new arrays?
The Compare-Object function is great, why not take it out for a stroll on these lists, it might just safe you lots of unnecessarily complicated code ...
You are creating a new $Domain, $Root and $Searcher object each iteration, when doing it once should suffice. Probably not much of a time-saver, but every little thing contributes.
Try pinpointing the problem by doing extensive logging, not only by writing which action was taken, but writing the inidividual information (variables, mostly) before evaluation occurs. Your if/elseif/else looks sound, so if it's still not doing what you
want, the ingoing data must be different from what you think should be there.
Cheers,
Fred
There's no place like 127.0.0.1 -
How to update bookmarks when merging two PDF files?
We have a company catalog that gets generated once a night. It's three step process:
Step 1) A raw XML file gets generated from our main ERP software (Microsoft Dynamics).
Step 2) Then that raw XML file is ran against a stylesheet with XEP to produce a nice professional looking catalog.
Step 3) And the third step is a script that merges the front and back covers with the main catalog produced in step 2. Each cover is two pages (front and back).
My problem is when step 3 runs it produces a final catalog but all the bookmarks are off by 2 pages because the front cover adds two pages in the very beginning. This post may be premature because up until now I've been merging the PDF pages with a program called "GhostScript" and it allows me to merge them via line command. I'm just now trying out AcroExch.App COM Object for VBScript so I'll see if it works but wanted to fire this out for help to see if anyone has encountered this or can confirm if Adobe automatically updates them for you? When I "Merge" the PDF files through Acrobat Pro they get updated automatically, so hopefully it will work the same way with AcroExch.App Object. Thanks guy!I think you might be misunderstanding what I'm saying... we are not performing tasks for non-licensed individuals. We purchased a copy of Adobe Acrobat Standard so we could create a PDF of our catalog. That catalog we then put on our website and let people download it. Since our products change all the time, we generate a new catalog every night. The term "server" is just a place where a script runs, I could have it run on my desktop computer if that's really an issue but I think we're talking semantics. Acrobat is not what produces the main catalog PDF, that is done through XEP when it runs through the raw XML produced by our ERP software every night. The only thing we want Acrobat to do is an automated process to merge 3 PDF files together: Front Cover, Main Catalog and Back Cover. That's it. Are you saying that is against the EULA of Adobe for us to do that?
Now for the bookmark problem, what do you recommend I do then? When I merge all three of those PDF files in Acrobat Standard manually it works perfect. All I'm trying to do is automate that process once every night. I know how to automate with Acrobat, I just can't figure out how to fix the bookmark problem? -
How to compare two XSD files programmatically
Hi
I want to compare two XSD files programmatically to find out whether one XSD is a sub set of another XSD(Means checking all the elements and attributes of one schema to be present in another schema).
Please let me know how this can be done in an efficient way.
Thanks in advance.
Mithun KOr simply apply an oracle text index on your pdf column:
SQL> create table t (id integer primary key, bl blob)
Table created.
SQL> declare
bf bfile := bfilename('TEMP','b32001.pdf');
bl blob;
begin
dbms_lob.createtemporary(bl,true);
dbms_lob.open(bf,dbms_lob.lob_readonly);
DBMS_LOB.LOADFROMFILE(bl, bf,dbms_lob.getlength(bf));
insert into t values (1,bl);
commit;
dbms_lob.close(bf);
dbms_lob.freetemporary(bl);
end;
PL/SQL procedure successfully completed.
SQL> create index t_idx on t (bl) indextype is ctxsys.context parameters ('filter ctxsys.auto_filter')
Index created.
SQL> declare
mklob clob;
begin
ctx_doc.filter ('t_idx', '1', mklob, true);
dbms_output.put_line (substr (mklob, 1, 250));
dbms_lob.freetemporary (mklob);
end;
Oracle® Database
Release Notes
11
g
Release 1 (11.1) for Linux
B32001-04
November 2007
This document contains important information that was not included in the
platform-specific or product-specific documentation
PL/SQL procedure successfully completed.This generates a text only version of your pdf and standard text comparison methods can be applied .... -
Comparing two text files in a UNIX using shell programming
Hi All,
Sorry for posting a UNIX shell query on Database forums.
I want to compare two text files using shell programming. The two text files are actually Business Objects output extracted in a text format. The two output files are not in a tabular format and are no way similar in looking. I want to take one file e.g. file1 as an input file and compare each line of file1 with the other file e.g. file2. During comparison I want to extract the differences found in another file and if possible the similar data as well.
Below is how the files will look like
File 1:
BILL1000000 1111251 122222
RMG1A2 023425100000000010001 11135 102650111100
UHL1 *6999999* *454540001* Weekly *000*
0544424556895PS DATA 01MPS100000/03 MR A A PERTH UTL1234567893106923455053106900000010000005
File 2:
AUTO
APPLICATION=STARTPOINT
START
PROCESSING DATE=01012011
1598301270320099TEST C E 00000031615 123456
7854301276140499TES P 00000062943 234567
UHL1 *6999999* *454540001* Weekly *000*
5569931233333499/123456789 00000013396 345678
4471931233333499ER K J 00000031835123456789012456789
33652931233333499E J L 00000034729123456789012567890
45783123333349921/123456789 00000039080 678901
1452931233333499T R 00000040678123456789012789012
59689312333334994/987654321 00000048614 890123
4112931233333499/987654321 00000060631 901234
1236931217836899 K S 00000043704 012345
END
As you can see above the file are not at all matching except for one record UHL1, but its just an example. As an output I would like to have a third file containing all these records, highlighting the differences, and a fourth file where in only the matched records should get populated.
Please post any useful scripts related to the above scenario.
Many Thanks.
Edited by: 848265 on 06-Apr-2011 04:13Hi;
For your issue i suggest close your thread here as changing thread status to answere and move it to Forum Home » Linux which you can get more quick response
Regard
Helios -
Writing a java program for generating .pdf file with the data of MS-Excel .
Hi all,
My object is write a java program so tht...it'll generate the .pdf file after retriving the data from MS-Excel file.
I used POI HSSF to read the data from MS-Excel and used iText to generate .pdf file:
My Program is:
* Created on Apr 13, 2005
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
package forums;
import java.io.*;
import java.awt.Color;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.Font.*;
import com.lowagie.text.pdf.MultiColumnText;
import com.lowagie.text.Phrase.*;
import net.sf.hibernate.mapping.Array;
import org.apache.poi.hssf.*;
import org.apache.poi.poifs.filesystem.*;
import org.apache.poi.hssf.usermodel.*;
import com.lowagie.text.Phrase.*;
import java.util.Iterator;
* Generates a simple 'Hello World' PDF file.
* @author blowagie
public class pdfgenerator {
* Generates a PDF file with the text 'Hello World'
* @param args no arguments needed here
public static void main(String[] args) {
System.out.println("Hello World");
Rectangle pageSize = new Rectangle(916, 1592);
pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
// step 1: creation of a document-object
//Document document = new Document(pageSize);
Document document = new Document(pageSize, 132, 164, 108, 108);
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream("c:\\weeklystatus.pdf"));
writer.setEncryption(PdfWriter.STRENGTH128BITS, "Hello", "World", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);
// step 3: we open the document
document.open();
Paragraph paragraph = new Paragraph("",new Font(Font.TIMES_ROMAN, 13, Font.BOLDITALIC, new Color(0, 0, 255)));
POIFSFileSystem pofilesystem=new POIFSFileSystem(new FileInputStream("D:\\ESM\\plans\\weekly report(31-01..04-02).xls"));
HSSFWorkbook hbook=new HSSFWorkbook(pofilesystem);
HSSFSheet hsheet=hbook.getSheetAt(0);//.createSheet();
Iterator rows = hsheet.rowIterator();
while( rows.hasNext() ) {
Phrase phrase=new Phrase();
HSSFRow row = (HSSFRow) rows.next();
//System.out.println( "Row #" + row.getRowNum());
// Iterate over each cell in the row and print out the cell's content
Iterator cells = row.cellIterator();
while( cells.hasNext() ) {
HSSFCell cell = (HSSFCell) cells.next();
//System.out.println( "Cell #" + cell.getCellNum() );
switch ( cell.getCellType() ) {
case HSSFCell.CELL_TYPE_STRING:
String stringcell=cell.getStringCellValue ()+" ";
writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
phrase.add(stringcell);
// document.add(new Phrase(string));
System.out.print( cell.getStringCellValue () );
break;
case HSSFCell.CELL_TYPE_FORMULA:
String stringdate=cell.getCellFormula()+" ";
writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
phrase.add(stringdate);
System.out.print( cell.getCellFormula() );
break;
case HSSFCell.CELL_TYPE_NUMERIC:
String string=String.valueOf(cell.getNumericCellValue())+" ";
writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
phrase.add(string);
System.out.print( cell.getNumericCellValue() );
break;
default:
//System.out.println( "unsuported sell type" );
break;
document.add(new Paragraph(phrase));
document.add(new Paragraph("\n \n \n"));
// step 4: we add a paragraph to the document
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
// step 5: we close the document
document.close();
My Input from MS-Excel file is:
Planning and Tracking Template for Interns
Name of the Intern N.Kesavulu Reddy
Project Name Enterprise Sales and Marketing
Description Estimated Effort in Hrs Planned/Replanned Actual Actual Effort in Hrs Complexity Priority LOC written new & modified % work completion Status Rework Remarks
S.No Start Date End Date Start Date End Date
1 setup the configuration 31/01/2005 1/2/2005 31/01/2005 1/2/2005
2 Deploying an application through Tapestry, Spring, Hibernate 2/2/2005 2/2/2005 2/2/2005 2/2/2005
3 Gone through Componentization and Cxprice application 3/2/2005 3/2/2005 3/2/2005 3/2/2005
4 Attend the sessions(tapestry,spring, hibernate), QBA 4/2/2005 4/2/2005 4/2/2005 4/2/2005
The o/p I'm gettint in .pdf file is:
Planning and Tracking Template for Interns
N.Kesavulu Reddy Name of the Intern
Enterprise Sales and Marketing Project Name
Remarks Rework Status % work completion LOC written new & modified Priority
Complexity Actual Effort in Hrs Actual Planned/Replanned Estimated Effort in Hrs Description
End Date Start Date End Date Start Date S.No
38354.0 31/01/2005 38354.0 31/01/2005 setup the configuration 1.0
38385.0 38385.0 38385.0 38385.0 Deploying an application through Tapestry, Spring, Hibernate
2.0
38413.0 38413.0 38413.0 38413.0 Gone through Componentization and Cxprice application
3.0
38444.0 38444.0 38444.0 38444.0 Attend the sessions(tapestry,spring, hibernate), QBA 4.0
The issues i'm facing are:
When it is reading a row from MS-Excel it is writing to the .pdf file from last cell to first cell.( 2 cell in 1 place, 1 cell in 2 place like if the row has two cells with data as : Name of the Intern: Kesavulu Reddy then it is writing to the .pdf file as Kesavulu Reddy Name of Intern)
and the second issue is:
It is not recognizing the date format..it is recognizing the date in first row only......
Plz Tell me wht is the solution for this...
Regards
[email protected]Don't double post your question:
http://forum.java.sun.com/thread.jspa?threadID=617605&messageID=3450899#3450899
/Kaj -
How do I combine two PDF files into one?
I want to merge two PDF files into one to make things easier when I take the file(s) to a professional printer.
Can I do this in Preview?
Thanks.You can't do in Preview.
You can combine individual PDFs into one PDF using one of these freeware utilities.
PDFMergeX @ http://www.malcom-mac.com/blog/pdfmergex/
joinPDF @ http://www.macupdate.com/info.php/id/16604
Combine PDFs @ http://www.monkeybreadsoftware.de/Freeware/CombinePDFs.shtml>
PDFLab (join & split) @ http://pdflab.en.softonic.com/mac
Cheers, Tom -
How to compare two excel files in java ?
how do i compare two excel files in java.?
I have two excel files stored on my computer in d: drive.
Ex:
D:\\file a
D:\\file b
How to compare the contents of these two files and print " files are equal " or "files not equal "Javamastermahe wrote:
I mean i want to print on the console "files are equal " or any message like " both the files match "If this is your requirement, this program satisfies it...
import java.util.Random;
public class SuperExcelTester {
public static void main(String[] args) {
Random rnd = new Random();
String[] messages = {
"files are equal",
"files are not equal",
"unexpected error"
int index = rnd.nextInt(messages.length);
System.out.println(messages[index]);
} -
How do I compare 2 PDF files for equality?
Hi,
I want to be able to compare 2 pdf files programmatically in C#.
I have tried using binary compare and I have found that
2 identical files do not match due to meta data I assume.
All I want to do is compare 2 files and match if
the displayed part is the same. The files have text, lines
and jpg.
If I cant do it in C# is there any library that can?
MalcolmThe Acrobat SDK includes a PDF compare function but its only available to plugins (written in C/C++).
-
Merge two PDF files into one with Adobe Reader
Does anyone know how to merge two PDF files into one with Adobe Reader. Is it even possible?
ThanksIf you've got a Mac and OSX you can do this in Preview. Make sure you can see the sidebar with the first PDF opened, and then drag the second PDF to the bottom of the last page in the sidebar. Also you can reduce the size of your saved file by selecting (or making) a Quartz filter to 'reduce file size'
Cheers
Maybe you are looking for
-
How to install oracle 10g in MAC OS X LION
Can some one help me in installing oracle 10g in my mac os xlion.. I also need to know where can i download ORACLE 10g for mac ??
-
When I go to play one of my itunes songs in my iphone 5 "Music," about a fourth of the time it will skip that song and go to the next, or skip 2 songs and play the third. Is the new phone defective or is there a setting I need to change? Thanks...
-
BOM Explosion/dependant requirements
Dear All, I have a concern regarding the "MRP 4" view in MM. BOM/Explosion Individual / Collective requirements "MRP 3" view Availability Check Availability Check (Daily / Individual) I would like to know the effect of these settings clearly with an
-
No Progress Screen Indicator Volume * Brightness v570
I have a lenovo v570 with windows 7 64-bit and am having problems with the progress bars on the screen with volume and brightness. The hotkeys still function correctly, but the bar that used to display near the bottom of my screen has suddenly disap
-
hi i have set my privacy settings to receive IMs from my contact list only BUT WHY AM STILL RECEIVING CONTACT REQUESTS FROM MORONS!!!! help help help