Cross Reference is not working as expected

Cross Reference is not working as expected. Pls note this issue was reproduced by aspose team and we are waiting for fix as well.

Refer to attached sample document. when same topic is added as cross reference then only first cross reference works, the second one fails.
This is for cross reference issue. Please follow attachment for the same
once you convert attached sample word file-Line no. 4311, you can see reference link referring to Field only i.e CR_Bookmark_No_0024

  • Delete an image in a Project (section Delete an Image File )
    once you convert attached sample word file-Line no 4385, referring to Filed as well as Hyperlink #_Delete_a_resource
  • Delete an image in a Project (section Delete an Image File)

@diemos Unfortunately, I cannot see any attachments in your post. Could you please attach the problematic document and provide code that will allow us to reproduce the problem? We will check the issue and provide you more information.

Reference doc attached

Cross Reference is not working as expected in one case. rest were fixed in previous drop you shared. but this one example is not working.

Refer to attached sample document. when same topic is added as cross reference then only first cross reference works, the second one fails.
This is for cross reference issue. Please follow attachment for the same
once you convert attached sample word file-Line no. 4311, you can see reference link referring to Field only i.e CR_Bookmark_No_0024

  • Delete an image in a Project (section [Delete an Image File](#cr_bookmark_no_00024) )
    once you convert attached sample word file-Line no 4385, referring to Filed as well as Hyperlink #_Delete_a_resource
  • Delete an image in a Project (section [Delete an Image File](#cr_bookmark_no_00024))

sample file attached

@diemos Unfortunately, I still do not see any documents and code attached.

crossrefdocs.docx (565.1 KB)

re-attached document again. pls refer to the work doc , conver it and see cross references are not working as expected

@diemos Thank you for additional information. I can see 4 hyperlinks in your document that refers to the following bookmarks:

  • CR_Bookmark_No_00024
  • _Delete_a_resource
  • _Create_a_Project_2
  • _Import_a_version_11

but only the first bookmark is there in the document, so only the first hyperlink is valid, other are broken since refers to non-existing bookmarks.

Hi, thank you for the response:

I have attached new document as previous one is see had broken links.

the issue is with the bookmark in word doc. whenever we have bookmark with same name as pose fix one cross reference bookmark but the next one with same name will not work.
see below example in attached doc: the bookmark called “Delete an Image File” appear twice but only one of them works and second doesn’t
work.

Cross references

Here is my first bookmark to “Code snippets.”

Here are my bookmarks to “Bulleted list” that is not working.

For more details, see “Heading 1”

And here is another bookmark to “Code snippets”

Delete an image in a Project (section “Delete an Image File”)

Cross references sub section

Here are my second bookmark:

Delete an image in a Project (section “Delete an Image File”)

Repaired dummy-doc for cross ref.docx (469.1 KB)

@diemos Unfortunately, I cannot reproduce the problem on my side. I have tried converting your document to variouse formats and cross-references works as expected. For example see PDF document produced on my side. All cross-references works fine.
out.pdf (520.8 KB)

Could you please provide code that will allow us to reproduce the problem? Also, please attach your problematic output document.

Hi,

thank you for your response but it will be very helpful if you can share the .md file as even in our word file the cross ref works but post conversion (word- .net) it doesn’t give expected results. even in the pdf you shared we do see ref errors. pls share the converted .md file.

@diemos Here is Markdown file produced by the following simple code:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.md");

out.zip (210.8 KB)

But you should note that MD format is very limited if compare to MS Word document formats and some features might not work in MD.

The errors shown in the provided PDF are expected. If you update fields in MS Word you will see the same errors. To avoid them you can disable updating fields in PDF save options:

Document doc = new Document(@"C:\Temp\in.docx");
PdfSaveOptions opt = new PdfSaveOptions();
opt.UpdateFields = false;
doc.Save(@"C:\Temp\out.pdf", opt);