No announcement yet.

Comparing pdf files from 2 different folders

  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing pdf files from 2 different folders

    Hi all,

    I have been using the GUI of Beyond Compare 3 for quite some while now. I use it to compare multiple pdf files wit text compare on a daily basis, which is a very tedious job. I recently saw that beyond compare supports scripting and wanted to see if i could get any help via scripting.
    I have a 2 folders which contain a number of pdf files with similar names in respective folders. I want to have a batch process which when run compare those pdf files and provide a report (either in a cluster form with mismatch of files with same names or a separate report for each comparison). Will be very glad if there is a solution for this.

    Saurabh Agarwal

  • #2
    Scripting mirrors the same actions you can take in the graphical interface, and wouldn't provide any additional functionality. The scripted folder compare would "load" target folders just like the interface. The difference is, you could load a parameter, and give it many sequential tasks, if that would help. Any file name changes would still need to be handled in the same way as the interface, either with alignment or passing in the exact file name as a parameter to generate the report:
    with bcompare.exe "@c:\bc\script.txt" "c:\bc\file1.pdf" "c:\bc\file2similarname.pdf" "c:\bc\report.html"
    text-report layout:side-by-side output-to:"%3" output-options:html-color "%1" "%2"
    Aaron P Scooter Software


    • #3
      Hi Aaron,

      Thanks a lot for the solutions provided i tried the same and i have few questions:-

      1. I am still not able to apply an iteration method through which i will be able to iterate both the folders and compare the files. Please help in the same.
      2. The result which is a html output develops a page which is similar to the GUI but i was trying to find a different kind of output which is more compressed(if there is any).
      3. If i have multiple files then will there be multiple report files or all the results will be consolidated in one html doc.
      4. Can i make a batch process and also can i schedule the whole process.
      5. Can i generate a new report document everytime the script is run with the date and timestamp.

      Thanks in advance
      Saurabh Agarwal
      Last edited by Saurabh1243; 08-Apr-2020, 05:16 PM.


      • #4
        1. BC3 does not have an iteration method. You could build a loop in another script or bat file, but given your other questions you may want to work on making sure the report can meet your needs first before diving too deep into coding.

        2. No, BC4's reporting in script is similar to the combinations offered in the Compare Report dialogs, Output types, Layouts and options. It's why I recommend using the interface first: you can load your folders and quickly generate a variety of reports from the dialog, to make sure one meets your needs.

        3. Internally, BC4 can join a parent folder compare report to child file view reports if Include Files Links is enabled for the Side By Side Folder Report. Is this a style you are looking for?
        Alternatively, BC3, if you select multiple files, right-click, and File Compare Report, this will generate a single report file for the multiple selected.

        4. Yes, but again I would stress generating a couple interactive reports first to make sure the core reporting meets your needs before investing in how to automate it.

        5. Yes, BC Scripting supports %date% and %fn_time% variables, which expand in the script to represent the date and time as text, and can be included as part of the report output-to:"c:\bcreports\bcreport%date%_%fn_time%.html" as an example
        Last edited by Aaron; 09-Apr-2020, 04:07 PM. Reason: Updating to BC3, as this all applies to BC3 as well, except for Linked File Reports, which is BC4-only
        Aaron P Scooter Software