Dear Team,
We have encountered an issue regarding document header preview. To illustrate the problem, I have attached a sample file, along with screenshots of the error observed both on GroupDocs site and within our application.
Could you please review the code changes and provide your suggestions on how we can resolve this issue?
GroupDocsSupport.zip (140.4 KB)
Best regards,
Anoop
Hi @anoop.raphel
Thank you for the provided file, we were managed to reproduce the described issue with an enexpected “Error! Unknown document property name” message in a page header using latest version of GroupDocs.Viewer. This is a bug and we already started to work on it. It is logged as VIEWERNET-5127 in our internal issue tracker. We will notify you when there will be some new regarding it.
Sorry for the inconvenience and with best regards,
Denis Gvardionov
Hi @anoop.raphel !
We’re glad to inform that the GroupDocs.Viewer for .NET 24.12 is finally released (can be found on NuGet or GroupDocs releases), and this version contains a fix for the reported problem. In order to process the provided Anoop-Raphel-Cyber-Handbook.docx
file properly, you need to disable updating fields before it - more on that is described here. In short, here is a code sample for your use-case:
const string filename = "Anoop-Raphel-Cyber-Handbook.docx";
string inputFilePath = Path.Combine("files", filename);
string outputTemplate = string.Format("{0}-page{{0}}.html", Path.GetFileNameWithoutExtension(filename));
HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources(outputTemplate);
viewOptions.WordProcessingOptions.UpdateFields = false;
using (Viewer viewer = new Viewer(inputFilePath))
{
viewer.View(viewOptions);
}
The viewOptions.WordProcessingOptions.UpdateFields = false
statement is the key here.
With best regards,
Denis