Hello,
I have read many posts in the forum to find the answer and solve my problem, I tried some recipies, but I have not found anything that gives a good result for my situation.
Before explanation, just keep in mind that we work only in memory, we get BLOB on Oracle Database for each document. Work them with Aspose Words always in memory and save the final document in PDF format in another BLOB in the database (we do not put anything on disk ).
Here is the situation:
I have a litte document Word containing Header (contining Page field and NumPages field)
and a footer containing static text and a body containing only a mergefield {Mergefield sect_sec_2} that is like a bookmark ton insert another document containing many pages of text.
In this case it contains 461 pages, another time it may contains more or less of pages.
So, using the breakpoints in debugging mode in C# :
I look Aspose detail of the first document, I see page 0001 of 000001.
Do a Document.UpdateFields() to put {Mergefield sect_sec_2} into <<sect_sec_2>>
I let go the treatment to insert the second document in place of <<sect_sec_2>>
I look again in Aspose detail and I see page 0001 of 000001.
I execute the research of NUMPAGES field and update it ==> Now I see page 0001 of 000461
But I cannot see each one of the values of PAGE field (that will appear on each page).
If I do a field.Update() on that field it turns to 461 (the number of the last page) and write it on all pages from the first to the last one.
I cannot do another document.UpdateFields() because I lose all the text of the second document inserted and I return to {Mergefield sect_sec_2} who has the result <<sect_sec_2>>.
I cannot use UnlinkFields because the PageField disappears.
I cannot use UnlinkFields because the PageField disappears.
I think there is a simple way but I just cannot find it in all the posts.
Hope that you understand my explanation.
Can you please help me
Thank’s a lot!