GroupDocs Comparison AppCompanent OnInit Metod

@kenankocer

We’re investigating it. You’ll be notified about the outcomes.

@kenankocer

You can implement this feature using the code that you can find in this commit, see also the complete file listing for more details.

The following code selects two files and calls compare method.

  ngOnInit() {
    const queryString = window.location.search;
    if (queryString) {
      const urlParams = new URLSearchParams(queryString);

      const firstFile = urlParams.get(Files.FIRST);
      const secondFile = urlParams.get(Files.SECOND);
      if(firstFile && secondFile) {
        this.selectFile(firstFile, '', '', Files.FIRST);
        this.selectFile(secondFile, '', '', Files.SECOND);
        this.compare();
        return;
      }
    }
  }

The page with the comparison result is going to be displayed automatically.

Please let us know if it works as expected on your side.

this did not solve the problem. “Controller” returns the result, but the page remains as attached.

filePath: C:\a\b\c.docx
filePath2: C:\a\b\c2.docx

this.selectFile(this.filePath, ‘’, ‘’, this.filePath);
this.selectFile(this.filePath2, ‘’, ‘’, this.filePath2);
this.compare();

compare() {
debugger;

if (this.credentials.size !== 2) {
return;
}
this.resultTabDisabled = false;
const arr = [];
arr.push(this.credentials.get(this.filePath));
arr.push(this.credentials.get(this.filePath2));
this.comparisonService.compare(arr).subscribe((result: CompareResult) => {
this.result = result;
const isZeroBasedPageId = this.result.changes.find((change) => change.pageInfo.pageNumber === 0);
this.result.changes.forEach( (change) => {
change.id = this.generateRandomInteger();
const zeroBasedId = isZeroBasedPageId ? change.pageInfo.pageNumber :
change.pageInfo.pageNumber - 1;
change.pageInfo.pageNumber = isZeroBasedPageId ? change.pageInfo.pageNumber :
change.pageInfo.pageNumber - 1;
if(!this.result.pages[zeroBasedId].changes){
this.result.pages[zeroBasedId].changes = [];
}
this.result.pages[zeroBasedId].changes.push(change);
change.normalized = {
x : this.pxToPt(change.box.x) * 100 / change.pageInfo.width,
y : this.pxToPt(change.box.y) * 100 / change.pageInfo.height,
width: this.pxToPt(change.box.width) * 100 / change.pageInfo.width,
height: this.pxToPt(change.box.height) * 100 / change.pageInfo.height,
};
});
}, (err => {
this.resultTabDisabled = true;
this.tabActivatorService.changeActiveTab(this.filesTab);
}));
this.tabActivatorService.changeActiveTab(this.resultTab);
}

The page looks like this.
image.png (16.9 KB)

Result
image.png (29.4 KB)

image.png (60.5 KB)

my guid .docx

3d68478a-711d-4cd4-bc53-3eb4c4218dfa.docx (70.4 KB)

There is no place where I get an error. I can receive the changes as “docx”, but I cannot load them on the page.

@Kkacar

As I can see from your code snippet you’re passing three parameters in selectFile method when four parameters are expected. Please also note that the fourth parameter values are constants, see

this.selectFile(this.filePath, '', '', Files.FIRST);
this.selectFile(this.filePath2, '', '', Files.SECOND);

Can you please update your code and double-check?

No there are four parameters.
FirsPameter= this.filePath
SecondParameter = ’ ’ (two single quotes)
ThirdParameter= ’ ’ (two single quotes)
FourthParameter = this.filePath
image.png (65.6 KB)

image.png (199.7 KB)

@Kkacar

Right, please try using Files.FIRST and Files.SECOND as the fourth parameter value.

I made the fourth parameter “Files.FIRST” and “Files.SECOND”. It gave an error.

(edit: I fixed the fourth parameter. I got no error. The result has not changed.)

@Kkacar

May you please clarify why have you withdrawn the topic? Have you managed to fix this issue?

My problem persists. Only when I entered the fourth parameter “FIRST” and “SECOND” I got no error.

The first problem I mentioned still persists.

(I wrote the topic I deleted as an edit in the post above.)

@Kkacar

Go it, thank you for the clarification. We’re looking into this issue.

image.png (283.5 KB)

image.png (44.4 KB)

@Kkacar

I’m sorry for the delayed response. Unfortunately, we’ve failed to reproduce this issue. It seems that the issue is located somewhere in the compare method as all of the requests in your screenshots are successful. Can you please attach the files you’re comparing?

The files I compared.

It just says “Test Verisi” (Test Data) in its content.
Folders “.docx with extension”

test1.docx (13.9 KB)
test.docx (13.7 KB)

Compared file
cfa8bd6c-a9b7-49d4-9f28-77337e09800e.docx (11.6 KB)

@Kkacar

Thank you for attaching the files. Unfortunately I can’t reproduce this issue see test-and-test1.png (64.7 KB). I’m using the sample app that can be downloaded at sample-app.zip.

Can you please provide your client (Angular) app code or a complete application that I could use to reproduce this issue?

Hello,

This project has not been opened, can you send it again?

@vladimir.litvinchik

Hello, in the project we developed as a test, when you press the “Compare” button manually, the selected “data image” appears. But in the project we are having a problem with, these images are not being loaded. Could this be the problem?

image.png (23.7 KB)

@Kkacar

I’ve updated and reuploaded the application, please try this link.
After the app is starts try pasting http://localhost:8080/comparison/?first=test.docx&second=test1.docx into the address bar.

@vladimir.litvinchik

I reviewed your project., My project is exactly the same.

Only difference

image.png (93.1 KB)
image.png (119.0 KB)

Do we have a chance to create live support with “AnyDesk” or “TeamViewer”?

I will be following this post. When we reply, we can connect.

@Kkacar

Unfortunately, we do not provide support over any remote management tools.

As I can see from the screenshots, the application is works as expected. Can you please clarify what was the expected behavior?

@vladimir.litvinchik

After the “compare” operation, the result information is returned. But the “Loading Please Wait” message freezes on the screen.
My Project
image.png (1.3 KB)

Your Project - Expected behavior
image.png (24.5 KB)