cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying a script to compare PDF's

SOLVED
Occasional Contributor

Modifying a script to compare PDF's

Hi!

 

I have a script that uses Acrobat DC to perform a PDF comparison. I need to add two more steps in the script in order to make a effective comparison. I'm not sure how to correctly map to the locations to perform a click and insert action. Are there any examples I could use for referance? Or documentation instucting how to use Object Spy to map a location?

 

Currently, the script clicks the comparison icon, which causes Adobe to make a comparison report, and then Test Complete performs a region check point on the results page.

 

Before the checkpoint is performed, I would like to first click the "New File" icon and change the zoom to 100%. See the screen shot attached. The tricky part is that Test Complete's object spy does not see "New File" as a object.

Script is below for referance!

 

Thanks!

 

//Compare
acrobat.wndAcrobatSDIWindow.AVFlipContainerView.AVDocumentMainView.AVFlipContainerView.AVScrollView.AVTableContainerView.Click(957, 600); // Clicks compare icon to generate report

acrobat.WaitWindow('AcrobatSDIWindow', '[Compare Report]*', -1, 30000); // delay
// (Select "New File" here)

// (Change zoom to 100% here)

//Take Region Checkpoint for expected differences
var pdfCheckpoint = eval('Regions.' + Project.Variables.PDFRegionCheckpoint);
pdfCheckpoint.Check(acrobat.wndAcrobatSDIWindow.AVFlipContainerView.AVDocumentMainView.AVFlipContainerView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView, false, false, 2000, 8);

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: Modifying a script to compare PDF's

Hi Kahle

 

Personally I would not do it that way. Smartbear have a whole example on how to compare using pdfbox

 

https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete

 

Images

https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete#Comparing_im...

 

I have used this before (comparing both image and text) and you can pretty much copy/paste the examples and setup as described and it "just works"! I used it to compare hundreds of pdf reports in a single test run (the reports were for a legacy app where you couldn't generate any other kind of format).

 

If you still want to use your original solution though this page might help where they mention exposing more of the adobe reader properties with MSAA (though the article is from 2016)

https://support.smartbear.com/viewarticle/65847/

 

m

1 REPLY 1
Highlighted
Frequent Contributor

Re: Modifying a script to compare PDF's

Hi Kahle

 

Personally I would not do it that way. Smartbear have a whole example on how to compare using pdfbox

 

https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete

 

Images

https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete#Comparing_im...

 

I have used this before (comparing both image and text) and you can pretty much copy/paste the examples and setup as described and it "just works"! I used it to compare hundreds of pdf reports in a single test run (the reports were for a legacy app where you couldn't generate any other kind of format).

 

If you still want to use your original solution though this page might help where they mention exposing more of the adobe reader properties with MSAA (though the article is from 2016)

https://support.smartbear.com/viewarticle/65847/

 

m

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors