How to show Documents on viewer when htmlmode: true in Configuration.yml file in Group Docs

15 Views Asked by At

In Group Docs, I’m facing issue in my application when i doing changes in Configuration.yml file htmlMode: false to htmlMode: true, my document is not view properly on viewer page. document is showing in html form not in proper form.

its like this:

enter image description here

And my code for that:

private HtmlViewOptions CreateHtmlViewOptions(int passedPageNumber = -1, int newAngle = 0)
{
    HtmlViewOptions htmlViewOptions = HtmlViewOptions.ForExternalResources(
    pageNumber =>
    {
        string fileName = $“p{pageNumber}.html”;
        string cacheFilePath = this.cache.GetCacheFilePath(fileName);
        return File.Create(cacheFilePath);
    },
    (pageNumber, resource) =>
    {
        string fileName = $"p{pageNumber}_{resource.FileName}";
        string cacheFilePath = this.cache.GetCacheFilePath(fileName);

        return File.Create(cacheFilePath);
    },
    (pageNumber, resource) =>
    {
        var urlPrefix = "/viewer/resources/" + Path.GetFileName(this.filePath).Replace(".", "_");
        return $"{urlPrefix}/p{ pageNumber}_{ resource.FileName}";
    });

    htmlViewOptions.SpreadsheetOptions.TextOverflowMode = TextOverflowMode.HideText;
    htmlViewOptions.SpreadsheetOptions.SkipEmptyColumns = true;
    htmlViewOptions.SpreadsheetOptions.SkipEmptyRows = true;
    SetWatermarkOptions(htmlViewOptions);

    if (passedPageNumber >= 0 && newAngle != 0)
    {
        Rotation rotationAngle = GetRotationByAngle(newAngle);
        htmlViewOptions.RotatePage(passedPageNumber, rotationAngle);
    }

    return htmlViewOptions;
}

how can i resolve these issue?

I wanting to do when i kept htmlmode:true in configuration.yml file, i will get proper document in viewer side. what can i do?

0

There are 0 best solutions below