Control Image Quality when Rendering PDF Document as HTML using GroupDocs.Viewer for .NET 18.3

GroupDocs Viewer for .NET

We are pleased to announce the release of version 18.3 of GroupDocs.Viewer for .NET. Using the latest version, you can now render XLTM and XLTX file formats. We have also added settings to control the image quality when rendering PDF documents as HTML. Furthermore, this version came up with 11 improvements and bug fixes. Let’s have a quick overview of GroupDocs.Viewer for .NET 18.3.

Supported File Formats

We have added the support of following file formats in version 18.3 of GroupDocs.Viewer for .NET.

  • XLTM (Excel Open XML Macro-Enabled Spreadsheet)
  • XLTX (Excel Open XML Spreadsheet Template)

Specifying Image Quality when Rendering PDF Documents as HTML

When rendering PDF documents as HTML, GroupDocs.Viewer creates a single image resource which contains all the images from the PDF document page. The API uses this image as the background for output HTML document. Since version 18.3, we have added the settings that are used to control the quality of the image resource. Following code sample shows how to get the best quality images when rendering PDF document as HTML.

//Init viewer configuration
ViewerConfig viewerConfig = new ViewerConfig();
viewerConfig.StoragePath = "c:\\storage";
   
// Init ViewerHtmlHandler 
ViewerHtmlHandler viewerHtmlHandler = new ViewerHtmlHandler(viewerConfig);
   
// Set the guid of the document you want to render
string guid = "with-images.pdf";
   
//Set desired image quality in the output HTML document
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.PdfOptions.ImageQuality = ImageQuality.High;
  
//Render document with specified options
List pages = viewerHtmlHandler.GetPages(guid, htmlOptions);

foreach (PageHtml page in pages)
{
    //..
}

For more details on this feature, please visit this documentation article.

Bug Fixes

Following issues are fixed in version 18.3 of GroupDocs.Viewer for .NET.

  • Text is garbled when rendering Arabic PDF
  • Blur output when rendering PDF as HTML
  • Printable HTML gets messy when adding watermark
  • Content minification prevents styles loading
  • Access to the path “../../fd.xml” is denied
  • ViewerConfig.FontDirectories property is not working for Presentation documents
  • Converting DNG image into JPG provides output with light spots

Improvements

Following are the improvements that we have made in version 18.3.

  • Extended support of HtmlOptions.ExcludeFonts option for Text documents
  • Improved rendering of MS OneNote documents into HTML by providing pure HTML and SVG
  • Exporting contained images when rendering SVG to HTML
  • Extended support of ShowHiddenSlides option for Open Document Presentation
  • Improved rendering of metafile images into HTML

Related Links and Resources

We have a few channels and resources for you to download, learn, try and get technical support on our document viewer API.

Feedback

As always, if you have any questions or suggestions, feel free to write on our forum.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

To keep up with our news, you can follow us on Twitter or follow our Facebook page.