Hi We are trying to upgrade groupdoc to its latest version and facing following issue:
I am trying to render word file to our UI as HTML.I did docx to html conversion using htmlsaveoption by following code:
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.IsResourcesEmbedded = true;
List pages = htmlHandler.GetPages(filename, htmlOptions);
but I am getting exception “Void Aspose.Words.Fonts.Font Settings.set_Default FontName(System.String)”
I tried adding Aspose.Words and applied font settings but still getting that exception. Also converted html pages has empty content because of this exception.
On UI side I have added all JS libraries, CSS files and following method to render the document on UI:
$(function () {
var viewerSyle = {
ScrollView: 1,
DoublePageFlip: 2,
OnePageInRow: 3,
TwoPagesInRow: 4,
CoverThenTwoPagesInRow: 5
};
$(’#documentViewer’).groupdocsViewer({
//filePath: ‘http://groupdocs.com/images/banner/carousel2/signature.png
’,
filePath: ‘word.doc’,
zoomToFitWidth: true,
//zoomToFitHeight: true,
showFolderBrowser: true,
showHeader: true,
showPaging: true,
showThumbnails: true,
showZoom: true,
width: 650,
height: 900,
isResourcesEmbedded: true,
useHtmlBasedEngine: true,
showDownload: true,
downloadPdfFile: true,
showPrint: true,
preloadPagesCount: 1,
usePdfPrinting: true,
showDocumentNavigation: true,
//supportPageRotation: true
});
EnableRightClickMenu = false;
$(’#documentViewer’)[0].oncontextmenu = function () { return EnableRightClickMenu; };
});
I am getting all groupdocs control on screen but document is not getting loaded.
Please provide me a possible solution for this
Hi there,
- Version of GroupDocs.Viewer API you are using.
- Are you using <a rel=“nofollow” href=“https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET/tree/master/Showcases/ASP.NET_WebForm_Front_End” class=“js-navigation-open” id=“3b1c9237c5322dddadcbaffe9171d725-c3928a6374e531544af6dfc83173dafe44ef67d0” title=“ASP.NET_WebForm_Front_End” style=“box-sizing: border-box; color: rgb(64, 120, 192); text-decoration: none; font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif, “Apple Color Emoji”, “Segoe UI Emoji”, “Segoe UI Symbol”; font-size: 14px; line-height: 20px; white-space: nowrap; background-color: rgb(255, 255, 255);”>ASP.NET_WebForm_Front_End or you have configured your own application?
- Please provide problematic Word document.
1:Using GroupDocs.Viewer 3.5.
2:Configuring my own application
3:I am using word.doc given under example project ASP.NET_WebForm_Front_End for testing purpose.
Here is the code which I am using :
string filename = “word.doc”;
FontSettings font = new FontSettings();
font.SetFontsFolder(Server.MapPath("~/css/fonts"),false);
font.DefaultFontName = “Arial Unicode MS”;
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.IsResourcesEmbedded = true;
List pages = htmlHandler.GetPages(filename, htmlOptions);
foreach (PageHtml page in pages)
{
//Save each page at disk
SaveAsHtml(page.PageNumber + “_” + filename, page.HtmlContent);
}
Using fontsetting to resolve exception but not working.
If you have any other simple solution to load docx file on web form that complete part will also help. Please provide front end .aspx code also in this case.
Thanks.
Hi there,