GroupDocs.Conversion for .NET 18.4 Release Notes

Major Features

There are 5+ new features, improvements and fixes in this regular monthly release. The most notable are:

  • Specify bookmark level, heading level and expanded level when converting Word to PDF and XPS
  • Linearize PDF Document for the Web when converting to PDF
  • Resource optimization options when converting to PDF
  • Option for applying image watermark
  • Create HTML5 compliant markup when converting to html
  • Bug fixes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
CONVERSIONNET‑2434Specify bookmark level, headings level and expanded level when converting from Words to PDF and XPSNew Feature
CONVERSIONNET‑2457Implement option for creating linearized PDF when converting to PDFNew Feature
CONVERSIONNET‑2458Implement option for converting to grayscale PDFNew Feature
CONVERSIONNET‑2459Implement option for resource optimization when converting to PDFNew Feature
CONVERSIONNET‑2471Implement option for applying image watermarkNew Feature
CONVERSIONNET‑2454Create HTML 5 compliant markup when converting to htmlImprovement
CONVERSIONNET‑2432Index was outside the bound of the array, when cache is enabled and watermarks are appliedFix

Public API and Backward Incompatible Changes

Introduced new property in WatemarkOptions

/// <summary>
/// Image watermark
/// </summary>
public byte[] Image { get; set; }

Usage

byte[] image = System.IO.File.ReadAllBytes ( "image.jpg" );
var saveOptions = new PdfSaveOptions();
saveOptions.WatermarkOptions.Image = image;

Introduced new property in PdfOptions

/// <summary>
/// Convert a PDF from RGB colorspace to Grayscale
/// </summary>
public bool Grayscale { get; set; } 

Usage

var saveOptions = new PdfSaveOptions();
saveOptions.PdfOptions.Grayscale = true;

Introduced new property in PdfOptions

/// <summary>
/// Linearize PDF Document for the Web
/// </summary>
public bool Linearize { get; set; } 

Usage

var saveOptions = new PdfSaveOptions();
saveOptions.PdfOptions.Linearize = true;

Introduced new property in PdfOptions

/// <summary>
/// Pdf optimization options
/// </summary>
public PdfOptimizationOptions OptimizationOptions { get; }

Usage

var saveOptions = new PdfSaveOptions();
 
// all images in the document are re-compressed. The compression is defined by the ImageQuality property.
saveOptions.PdfOptions.OptimizationOptions.CompressImages = true;
 
//  value in percent where 100% is unchanged quality and image size. To decrease the image size, use ImageQuality less than 100
saveOptions.PdfOptions.OptimizationOptions.ImageQuality = 50;
 
// Link duplcate streams
saveOptions.PdfOptions.OptimizationOptions.LinkDuplcateStreams = true;
 
// Remove unused objects
saveOptions.PdfOptions.OptimizationOptions.RemoveUnusedObjects = true;
 
// Remove unused streams
saveOptions.PdfOptions.OptimizationOptions.RemoveUnusedStreams = true;
 
// Make fonts not embedded if set to true
saveOptions.PdfOptions.OptimizationOptions.UnembedFonts = true;

Introduced new property WordBookmarkOptions in PdfSaveOptions

/// <summary>
/// If the input document is Word the conversion will handle the word bookmarks regarding this option.
/// </summary>
public WordBookmarksOptions WordBookmarkOptions { get; }

Usage

var saveOptions = new PdfSaveOptions();
saveOptions.WordBookmarkOptions.BookmarksOutlineLevel = 5;
saveOptions.WordBookmarkOptions.HeadingsOutlineLevels = 5;
saveOptions.WordBookmarkOptions.ExpandedOutlineLevels = 9;