Hi
We are using Aspose.Words.dll version 10.5.0.0 to produce highly customized documents.
The generated documents may have cross-reference in them. We are facing problem when there is reference to a heading (only number part of it) or a footnote (not complete only number part of it) or a page number. For ex PFA document in which:
There are references example for footnote, Heading and page number
We are generating output by taking ASPOSe HTML as input. Now in the input HTML, we are not getting any indication or hint that this refers to a heading or a footnote or any page number. Because these are numbers and through only number we cannot identify this number is for heading or for footnote or for page number. Please provide if any solution is possible.
Please find below code for your reference which we have used to generated the html for input word document
string htmlText = string.Empty;
Aspose.Words.Document doc = new Aspose.Words.Document(filepath);
if (doc.Sections != null && doc.Sections.Count > 1)
{
doc.Sections.RemoveAt(0);
string lStrImageFolder = string.Empty;
lStrImageFolder = FolderPath + "/" + ConfigurationManager.AppSettings["HTMLFileFolderName"].ToString();
string tempDir = Path.Combine(Server.MapPath(lStrImageFolder));
if (!Directory.Exists(tempDir))
Directory.CreateDirectory(tempDir);
Aspose.Words.Saving.HtmlSaveOptions saveOptions = new Aspose.Words.Saving.HtmlSaveOptions();
saveOptions.ImagesFolder = tempDir;
saveOptions.CssStyleSheetType = Aspose.Words.Saving.CssStyleSheetType.Embedded;
saveOptions.SaveFormat = SaveFormat.Html;
saveOptions.ImagesFolderAlias = ConfigurationManager.AppSettings["HTMLFileFolderName"].ToString();
doc.JoinRunsWithSameFormatting();
doc.ExpandTableStylesToDirectFormatting();
MemoryStream htmlStream = new MemoryStream();
doc.Save(htmlStream, saveOptions);
htmlText = Encoding.UTF8.GetString(htmlStream.GetBuffer());
htmlStream.Close();
this.HTMLFilePath = FolderPath + "/" + ConfigurationManager.AppSettings["HTMLFileName"].ToString();
StreamWriter sr = new System.IO.StreamWriter(Server.MapPath(this.HTMLFilePath), false, Encoding.Default);
StringBuilder strStylePath = new StringBuilder();
strStylePath.Append(htmlText);
}
So please let us know if is there any way to get the clue at HTML side for identify cross reference source.
Thanks,
Samanvay