GroupDocs.Viewer For .NET 3.5.0 Release Notes

Major Features

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

  • Implemented saving Cells document sheet to multiple pages in image mode.
  • Ability to specify font for watermark.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-733Implement saving Cells document sheet to multiple pages in image modeNew Feature
VIEWERNET-787Implement ability to specify font for watermarkNew Feature
VIEWERNET-616Implement GetPdfFile from stream or remote fileImprovement
VIEWERNET-721Improve Words files to html rendering speedImprovement
VIEWERNET-732Implement saving file data separately based on optionsImprovement
VIEWERNET-748Implement releasing converters resourcesImprovement
VIEWERNET-529Cannot add page to pdf documentBug
VIEWERNET-564OutOfMemoryException raised when total readed file size reached upto 250MBBug
VIEWERNET-627The operation is not supported error raised when loading epub documentBug
VIEWERNET-667IOException is raised when try to move a loaded document(into the viewer) to any other directoryBug
VIEWERNET-691Cell shading is not applied uniformly while converting spreadsheet to HTMLBug
VIEWERNET-717Ott file stream detects as ods file formatBug
VIEWERNET-729GetDocumentInfo() Throws “Parameter is not valid” ExceptionBug
VIEWERNET-753Excel file is not properly rendering into HTMLBug
VIEWERNET-776Header contents of Word document are not appearing in rendered html or imagesBug
VIEWERNET-779Exception generated while calling handler.getDocumentInfo(uuid)Bug
VIEWERNET-780Exception when calling GetPdfFile/RotatePage/ReorderPage with guid without extensionBug
VIEWERNET-784Incorrect watermark position and text in PDF fileBug
VIEWERNET-786Out Of Memory Exception While Rendering Excel File into HTMLBug
WEB-1869Each page of a Word document is converted to HTML too longBug
WEB-2000Incorrect saving PDF to HTMLBug
WEB-2081There is no text in tables of a PDF after conversion to HTMLBug
WEB-2349Text selection is unstable in Firefox on the HTML engineBug

Public API and Backward Incompatible Changes

Implemented GetPdfFile from stream or remote file public methods.

Get original file in Pdf format without transformations

v3.5.0 and higher (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

string guid = "word.doc";

// Get file as pdf
FileContainer container = imageHandler.GetPdfFile(guid);
Console.WriteLine("Stream lenght: {0}", container.Stream.Length);


Get original file in Pdf format with Watermark

Add watermark to Pdf document by setting Watermark property of PdfFileOptions.

v3.5.0 and higher (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

string guid = "word.doc";

// Set watermark properties
Watermark watermark = new Watermark("This is watermark text");
watermark.Color = System.Drawing.Color.Blue;
watermark.Position = WatermarkPosition.Diagonal;
watermark.Width = 100;

PdfFileOptions options = new PdfFileOptions();
options.Watermark = watermark;

// Get file as pdf with watermaks
FileContainer container = imageHandler.GetPdfFile(guid, options);
Console.WriteLine("Stream lenght: {0}", container.Stream.Length);


Get original file in Pdf format with Watermark and Font name specified

Add watermark to Pdf document by setting Watermark property of PdfFileOptions.
Specify watermark font name by setting FontName property of Watermark.

v3.5.0 and higher (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

string guid = "word.doc";

// Set watermark properties
Watermark watermark = new Watermark("透かし文字、");
watermark.Color = System.Drawing.Color.Blue;
watermark.Position = WatermarkPosition.Diagonal;
watermark.Width = 100;
// Set watermark font name which contains Japanese characters
watermark.FontName = "MS Gothic";

PdfFileOptions options = new PdfFileOptions();
options.Watermark = watermark;

// Get file as pdf with watermaks
FileContainer container = imageHandler.GetPdfFile(guid, options);
Console.WriteLine("Stream lenght: {0}", container.Stream.Length);


Get original file in Pdf format with print action

Add watermark to Pdf document by setting AddPrintAction property to True of PdfFileOptions.

v3.5.0 and higher (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

string guid = "word.doc";

// Set add print action property
PdfFileOptions options = new PdfFileOptions();
options.Transformations = Transformation.AddPrintAction;

// Get file as pdf with print action
FileContainer container = imageHandler.GetPdfFile(guid, options);
Console.WriteLine("Stream lenght: {0}", container.Stream.Length);


Get original file in Pdf format with transformations

Add watermark to Pdf document by setting Transformations property of PdfFileOptions.

v3.5.0 and higher (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);

string guid = "word.doc";

// Perform page rotation
RotatePageOptions rotatePageOptions = new RotatePageOptions(guid, 1, 90);
imageHandler.RotatePage(rotatePageOptions);

// Reorder pages, move 1 page to the 2 position, it is assumed that "word.doc" document has at least two pages
ReorderPageOptions reorderPageOptions = new ReorderPageOptions(guid, 1, 2);
imageHandler.ReorderPage(reorderPageOptions);

// Set apply rotate and reorder transformations
PdfFileOptions options = new PdfFileOptions();
options.Transformations = Transformation.Rotate | Transformation.Reorder | Transformation.AddPrintAction;


// Get file as pdf with transformations
FileContainer container = imageHandler.GetPdfFile(guid, options);
Console.WriteLine("Stream lenght: {0}", container.Stream.Length);


Public API changes

1. ViewerHandler.GetPdfFile(PdfFileOptions) marked as ‘Obsolete’
2. PdfFileOptions class all constructors except parameterles are marked as ‘Obsolete’
3. Added new ViewerHandler methods:

FileContainer GetPdfFile(string guid);
FileContainer GetPdfFile(string guid, PdfFileOptions pdfFileOptions);
FileContainer GetPdfFile(Stream fileStream);
FileContainer GetPdfFile(Stream fileStream, PdfFileOptions pdfFileOptions);
FileContainer GetPdfFile(Stream fileStream, string fileName);
FileContainer GetPdfFile(Stream fileStream, string fileName, PdfFileOptions pdfFileOptions);
FileContainer GetPdfFile(Uri uri);
FileContainer GetPdfFile(Uri uri, PdfFileOptions pdfFileOptions);
FileContainer GetPdfFile(Uri uri, WindowsAuthenticationCredential credential, PdfFileOptions pdfFileOptions);

Implemented saving Cells document sheet to multiple pages in image mode.

Public API changes: Option CellsOptions.OnePagePerSheet now supported by ImageHandler.

Multiple pages per sheet with GetPages method in Image mode

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = TestHelper.StoragePath;

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "document.xlsx";

// Set pdf file one page per sheet option to false, default value of this option is true
ImageOptions imageOptions = new ImageOptions();
imageOptions.CellsOptions.OnePagePerSheet = false;

//Get pages
List<PageImage> pageImages = imageHandler.GetPages(guid, imageOptions);


Implemented setting ‘FontName’ which allows users to specify font name for watermark text.

Public API changes:
#Class: GroupDocs.Viewer.Domain.Watermark, Added field: public string FontName { get; set; }

Add Watermark with Font name to Image page representation

Add watermark to document pages by setting Watermark property of ImageOptions.
Specify watermark font name by setting FontName property of Watermark.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "word.doc";

ImageOptions options = new ImageOptions();

// Set watermark properties
Watermark watermark = new Watermark("透かし文字、");
watermark.Color = System.Drawing.Color.Blue;
watermark.Position = WatermarkPosition.Diagonal;
watermark.Width = 100;
// Set watermark font name which contains Japanese characters
watermark.FontName = "MS Gothic";

options.Watermark = watermark;

// Get document pages image representation with watermark
List<PageImage> pages = imageHandler.GetPages(guid, options);


Add Watermark with Font name to Html page representation

Add watermark to document pages by setting Watermark property of HtmlOptions.
Specify watermark font name by setting FontName property of Watermark.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
string guid = "word.doc";

HtmlOptions options = new HtmlOptions();

// Set watermark properties
Watermark watermark = new Watermark("This is watermark text");
watermark.Color = System.Drawing.Color.Blue;
watermark.Position = WatermarkPosition.Diagonal;
watermark.Width = 100;
// Set watermark tag font-family css property
watermark.FontName = "\"Comic Sans MS\", cursive, sans-serif";

options.Watermark = watermark;

// Get document pages html representation with watermark
List<PageHtml> pages = htmlHandler.GetPages(guid, options);