Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2016
    Location
    Earth
    Posts
    3

    Exclamation pdf text compare on cmd line returns 13, even with Grammar exclusion

    We are using BC on the cmd line to compare 2 pdf files and return match or not matched. There are date fields in the pdf which we have successfully used Importance - Grammar to exclude within the GUI. There we are able to see the mismatched text turn blue denoting the mismatches that are ok. We did get this to work ok with docx files on the cmd line, but now with similar steps to exclude mismatched dates with our pdf files, the cmd code below is returning Error Code = 13 (Rules Based Differences).

    I am guessing that the imported bcpkg settings are not being ignored, but I have tried to comment the load out and set it up manually in the GUI, but on the cmd its still returning Error=13. Its odd that it works fine for us with docx files but we have issues with our pdf files. The only difference is that there is only 1 exception with the docx and there are 3 exceptions with the pdf (due to the text spanning multiple lines).

    Thoughts on how to programmatically ensure the cmd compare returns a "Match" after excluding our exceptions?


    Code:
    @echo off
    
    set file1=%1
    set file2=%2
    
    if not exist "C:\Program Files\Beyond Compare 4\bcomp.com" goto error
    
    "C:\Program Files\Beyond Compare 4\bcompare" "Z:\Automation_Tools\Beyond Compare\PolicyGenDate_pdf.bcpkg" /silent
    
    echo %ERRORLEVEL%
    echo Imported bcpkg
    
    "C:\Program Files\Beyond Compare 4\bcomp.com" /qc %file1% %file2%
    
    echo %ERRORLEVEL%

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    Hello,

    From the script, if you remove "/qc" and launch the graphical interface, does this show the diff as you expect? Does it show any differences? Are the grammar elements marked as Unimportant by default?
    Aaron P Scooter Software

  3. #3
    Join Date
    Oct 2016
    Location
    Earth
    Posts
    3

    Exclamation How to Programmatically uncheck (deselect) the grammar exceptions

    It displays and works properly in the GUI, after I deselected the grammar elements that I want it to ignore, and selected "Also update session defaults" and save that on the GUI. Then I can run from the cmd line and it works as expected.

    The issue I continue to have is that I want to import specific grammar items via the cmd line that I want to ignore. I know that I can do the import with the line:

    Code:
    "C:\Program Files\Beyond Compare 4\bcompare" "Z:\Automation_Tools\Beyond Compare\PolicyGenDate_pdf.bcpkg" /silent
    But importing the grammar items only loads them. I then need to programmatically uncheck (deselect) the grammar exceptions (to allow Beyond Compare to ignore them). How do I deselect these via cmd line after importing the file?

    Thank you in advance!

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    Hello,

    The bcpkg needs to have the global defaults set to have that grammar as Unimportant, and then export to create the .bcpkg file.

    Importing the bcpkg with the Text Compare default set and the grammar element in the File Format, does this help get you up and running?
    Aaron P Scooter Software

  5. #5
    Join Date
    Oct 2016
    Location
    Earth
    Posts
    3

    Default

    It looks like I have to have multiple bcpkg files and import them individually, rather than import 1 and turn on/off the individual exceptions. This is a bit slower and more configuration, but is doable.

    Thanks

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    Hello,

    You shouldn't need multiple bcpkg files. Configure the graphical interface Text Compare session defaults and the additional File Format grammar. The exported bcpkg needs to include both Sessions -> Text Compare default and File Formats -> your custom Format with grammar included.

    You can then test an import graphically to note that in a clean, portable install it brings in both the Text defaults and Format, and open a file to note it defaults to Unimportant (without needing any user input). Scripting with this bcpkg should then work, too.
    Aaron P Scooter Software

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •