testlinks3000.docx (10.8 KB)
I just added my test case file and this is my code .
Aspose.Words.Document doc = new Aspose.Words.Document(decodedInputPath);
doc.Save(decodedInputPath);
testlinks3000.docx (10.8 KB)
I just added my test case file and this is my code .
Aspose.Words.Document doc = new Aspose.Words.Document(decodedInputPath);
doc.Save(decodedInputPath);
@fateh2024 I am afraid, it is still not clear how to reproduce the problem. As I can see in your document there are two pairs of links that uses the same target. After open/save using Aspose.Words the links still points to the same target the same way as in the source document.
@alexey.noskov You are right , but when we open this document(was processd by Aspose) in Trados Studio and change one link another link with same hyperlink is affected however if we do the same action with a word file without processing Aspose, it normally works and changing a link doesn’t effect another link with same hyperlink.
@alexey.noskov It looks like saveing in Aspose makes dependecies links with same hyperlink, or maybe Aspose add same bookmark over links with same hyperlink!!!
@fateh2024 Unfortunately, I do not see what might cause the problem. As I can see the links are stored the same way in both input and output documents. The actual links are defined in document.xml.rels
like this:
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\dev-appsettings-moulinsart.txt" TargetMode="External" />
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\test-doc-without-macro.doc" TargetMode="External" />
Then the links are used in the document.xml
like this:
<w:hyperlink r:id="rId4" w:history="1">
.....
<w:hyperlink r:id="rId4" w:history="1">
.....
<w:hyperlink r:id="rId5" w:history="1">
.....
<w:hyperlink r:id="rId5" w:history="1">
I do not think the problem is in Aspose.Words. I think the problem should be reported to Trados Studio.
Also, as I can see, the document testlinks3000.docx
you have attached was also generated by Aspose.Words 24.2 version. So the only change made after open/save of this document is the change in generated by
comment.
@alexey.noskov I see size original file and save file in Aspose are not the equale.I attached original file and save file.
It looks, Aspose has reduced the size. is there anyway we prevent this in the code?
after-save-Apsose-testlinks.docx (10.8 KB)
Original-testlinks.docx (13.5 KB)
@fateh2024 When you open document using Aspose.Words, it read the whole document into Aspose.Words Document Object Model. When document is saved, Aspose.Words reconstructs the file from the DOM. So there is no way to preserve the file as is after processing the document using Aspose.Words.
@alexey.noskov I tested this scenario with MemoQ too, I get the same result as Trados Studio.
It looks Aspose save algorith makes this issue (changing a link make change in another link with same URL)
With orginal file MemoQ and Trados Studio , are OK , just exported file in Aspose has issue.
@alexey.noskov This is very critical for our company , we have license and we expect you fix this issue ASAP.
@alexey.noskov I understand what makes the problem .
I created Original-test.docs with two links and make After-save-Aspose-test.docs.
I realized the original file has two different Ids for hyper link :
@fateh2024 The links are duplicated in document.xml.rels
:
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\test-doc-without-macro.doc" TargetMode="External"/>
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\dev-appsettings-moulinsart.txt" TargetMode="External"/>
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\dev-appsettings-moulinsart.txt" TargetMode="External"/>
So Aspose.Words writes the duplicated link as a single link.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-27535
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as WORDSNET-27535) have been fixed in this Aspose.Words for .NET 24.12 update also available on NuGet.
I’ve installed new version 24.12 and redid the test, the issue is not fixed and I have encountered the same issue.
The consequence of this issue is when we change a link by Apps like Trados or MemoQ, another link will be change automatically.
@fateh2024 I rechecked the scenario on my side with 24.12 version and duplicated links are written separately as expected:
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\dev-appsettings-moulinsart.txt" TargetMode="External" />
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\dev-appsettings-moulinsart.txt" TargetMode="External" />
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\test-doc-without-macro.doc" TargetMode="External" />
<Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="file:///C:\Users\fahmadi\Documents\test-doc-without-macro.doc" TargetMode="External" />
Did you use the same test document on your side? Could you please attach your input and output documents here for our reference?
Please look at WORDSNET-27670
https://www.google.com
.document.xml.rels
files of both the original and saved documents, I found the following:rId4
and rId5
.rId4
remains.@fateh2024
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-27670
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.