GroupDocs.Viewer For .NET 3.7.0 Release Notes

Major Features

There are 4 new features and 16 improvements and fixes in this regular monthly release. The most notable are:

  • Save HTML resources to cache without saving them to local disc
  • Improve rendering Pdf Dynamic XFA Forms
  • Ability to set default font when rendering Diagram documents
  • EMF and DICOM file format rendering support
  • Fixed HTML watermark rendering

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WEB-1084The ability to show and hide PDF layersNew Feature
VIEWERNET-871Ability to set default font when rendering Diagram documentsNew Feature
VIEWERNET-851Implement support of EMF file type.New Feature
VIEWERNET-549DICOM format supportNew Feature
VIEWERNET-899Convert Pdf Dynamic XFA Form to Standard AcroFormImprovement
VIEWERNET-895Mark CachedPageDescription redundant constructor as ObsoleteImprovement
VIEWERNET-873Save HTML resources to cache without saving them to local disc.Improvement
WEB-2425Incomprehensible characters when view pdfBug
WEB-2038Text issues when saving document containing XFA form to HTMLBug
VIEWERNET-866Html watermark style block contains garbage characters.Bug
VIEWERNET-865Html watermark style block contains garbage characters.Bug
VIEWERNET-863Watermark is Rendered Incorrectly in Html RepresentationBug
VIEWERNET-838Wmf file dimensions are different from dimensions in the MS Paint.Bug
VIEWERNET-834TeX to Html conversion errorBug
VIEWERNET-829Incorrect Rendering of PDF Document into ImageBug
VIEWERNET-811The output pdf file contains black pages instead of content when converting djvu to pdf.Bug
VIEWERNET-794DefaultRegularFont setting doesn’t work properlyBug
VIEWERNET-566Specific pdf document can’t be saved as HTMLBug
VIEWERNET-496Exception when converting document to HTML after cleanupBug
VIEWERNET-437Some characters not displayed when rendering HTML or PNGBug

Public API and Backward Incompatible Changes

  1. Mark CachedPageDescription redundant constructor as Obsolete
    1. Class GroupDocs.Viewer.Domain.CachedPageDescription constructor public CachedPageDescription(string guid, CacheFileType cacheFileType) marked as ‘obsolete’
  2. Improve CAD files rendering
    1. Class GroupDocs.Viewer.Domain.DocumentTypeName constant public const string Autocad = “Autocad”; changed to public const string CAD = “CAD”;
  3. Update public classes fields access modifiers.
    1. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_CORRUPTED_OR_DAMAGED_FILE
    2. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_FILE_TYPE_NOT_SUPPORTED
    3. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_INVALID_PASSWORD
    4. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_PASSWORD_PROTECTED_FILE
    5. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_STORAGE_PATH_NOT_SPECIFIED
    6. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_CACHE_FILE_NOT_FOUND
    7. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_GUID_NOT_SPECIFIED
    8. Class GroupDocs.Viewer.Localization.LocalizedStringKeys new contant EXC_TMPL_TRANSFORMATION_FAILED_PAGE_NOT_EXIST

Set default font name

Default font name may be specified in this cases:

  1. You want to generally specify the default font to fall back on if particular font in a document cannot be found during rendering.
  2. Your document uses fonts that non-English characters and you want to make sure any missing font is replaced with one that has the same character set available.
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
config.DefaultFontName = "Calibri";

Working with layers in HTML representation of pdf documents

Starting from version 3.7.0 the rendering Pdf documents into HTML representation was improved.
It is possible to work with layers in HTML representation of Pdf document (e.g. show\hide) with help of javascript.
Each layer is separated into

tag which has Html data tag “data-pdflayer” and its value contains layer name.
For example Pdf document has layer with name “Backgroung” so output html will contain tag

HTML

<div data-pdflayer="Backgroung"> .... </div>

This layer can be easily accessed with javascript, see the example how to access and hide layer with help of JQuery.

JavaScript

// get layer
var layer = $("[data-pdflayer='Backgroung']");

// hide layer
layer.hide();

// show layer
layer.show();

// get all layers
var allLayers = $("[data-pdflayer]");

// go throught all layers and print layer name
allLayers.each(function(index) {
    console.log(index + ": " + $(this).data("pdflayer"));
});