GroupDocs.Conversion for .NET 18.11 Release Notes

Major Features

This regular monthly release contains 10+ improvements and bug fixes. Most notable are: 

  • Improved options to make them more meaningful
  • Conversions from EPS
  • Conversions from/to TSV
  • Conversion from Pcl
  • Rotate feature when converting to image
  • ConvertedDocument extended with additional property which contain conversion elapsed time

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
CONVERSIONNET‑2814Move HideWordTrackedChanges option to WordsLoadOptions classImprovement
CONVERSIONNET‑2815Move HidePdfAnnotations option to PdfLoadOptions classImprovement
CONVERSIONNET‑2816Move HideComments option to CellsLoadOptions, Slides CellsLoadOptions and WordsLoadOptions classImprovement
CONVERSIONNET‑1509Implement conversion from EPSFeature
CONVERSIONNET‑2781Implement conversion from TSV and to TSVFeature
CONVERSIONNET‑2786Implement conversion from PclFeature
CONVERSIONNET‑2797Implement setting default font and font substitution options when converting One documentFeature
CONVERSIONNET‑2799Implement setting default font when converting Psd, Emf, Wmf documentsFeature
CONVERSIONNET‑2801Measure conversion time and return it as property of ConvertedDocument classFeature
CONVERSIONNET‑2802Set font load folders when converting Image documentsFeature
CONVERSIONNET‑2810Implement rotation feature when converting to imageFeature
CONVERSIONNET‑2818Implement option for flatten all form fields when converting PdfFeature
CONVERSIONNET‑2825Implement page rotation when converting to PdfFeature
CONVERSIONNET‑2826Implement option for including hidden slides in converted document when converting from SlidesFeature
CONVERSIONNET‑2828Set default font when converting from DiagramFeature

Public API and Backward Incompatible Changes

Measure conversion time and return it as property of ConvertedDocument class

/// <summary>
/// Class for handling converted document
/// </summary>
public sealed class ConvertedDocument
{
    ...
    /// <summary>
    /// Get the total elapsed time for the conversion in milliseconds
    /// </summary>
    public long Elapsed { get; private set; }
    ...
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.docx";
var saveOptions = new PdfSaveOptions();
var convertedDocument = conversionHandler.Convert(source, saveOptions);
Console.WriteLine("Elapsed time: {0}ms", convertedDocument.Elapsed);
...

Option for including hidden slides in converted document when converting from Slides

/// <summary>
/// Slide document load options
/// </summary>
public class SlidesLoadOptions: LoadOptions
{
    ...
    /// <summary>
    /// Show hidden slides
    /// </summary>
    public bool ShowHiddenSlides { get; set; }
    ...
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.pptx";
var loadOptions = new SlidesLoadOptions
{
    ShowHiddenSlides = true
};
var saveOptions = new PdfSaveOptions();
var convertedDocument = conversionHandler.Convert(source, loadOptions, saveOptions);
convertedDocument.Save("result");
...

Option for page rotation when converting to Pdf

/// <summary>
/// Options for to PDF conversion
/// </summary>
public class PdfSaveOptions : SaveOptions
{
    ...
    /// <summary>
    /// Rotation enum
    /// </summary>
    public enum Rotation
    {
        /// <summary>
        /// None
        /// </summary>
        None,
        /// <summary>
        /// 90 degrees
        /// </summary>
        On90,
        /// <summary>
        /// 180 degrees
        /// </summary>
        On180,
        /// <summary>
        /// 270 degrees
        /// </summary>
        On270
    }
    ...
    /// <summary>
    /// Rotate page
    /// </summary>
    public Rotation Rotate { get; set; }
    ...
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.docx";
var saveOptions = new PdfSaveOptions {
    Rotate = PdfSaveOptions.Rotation.On90
};
var convertedDocument = conversionHandler.Convert(source, saveOptions);
convertedDocument.Save("result");
...

Option to flatten all form fields when converting Pdf

/// <summary>
/// Pdf document load options
/// </summary>
public class PdfLoadOptions : LoadOptions
{
    ...
    /// <summary>
    /// Flatten all the fields of the PDF form
    /// </summary>
    public bool FlattenAllFields { get; set; }
    ...
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.pdf";
var loadOptions = new PdfLoadOptions
{
    FlattenAllFields = true
};
var saveOptions = new WordsSaveOptions();
var convertedDocument = conversionHandler.Convert(source, loadOptions, saveOptions);
convertedDocument.Save("result");
...

Rotation feature when converting to image

/// <summary>
/// Options for to Image conversion
/// </summary>
public class ImageSaveOptions : SaveOptions
{
    ...
    /// <summary>
    /// Image rotation angle 
    /// </summary>
    public int RotateAngle { get; set; }
    ...
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.pdf";
var saveOptions = new ImageSaveOptions {
    RotateAngle = 45
};
var convertedDocument = conversionHandler.Convert(source, saveOptions);
convertedDocument.Save("result");
...

Set default font and font substitution options when converting One document

/// <summary>
/// One document load options
/// </summary>
public class OneLoadOptions: LoadOptions
{
    /// <summary>
    /// Default font for Note document. The following font will be used if a font is missing.
    /// </summary>
    public string DefaultFont { get; set; }
    /// <summary>
    /// Substitute specific fonts when converting Note document.
    /// </summary>
    public IList<KeyValuePair<string, string>> FontSubstitutes { get; }
    /// <summary>
    /// Set password to unprotect protected document
    /// </summary>
    public new string Password { get; set; }
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.one";
var loadOptions = new OneLoadOptions
{
    DefaultFont = "Helvetica",
};
loadOptions.FontSubstitutes.Add(new KeyValuePair<string, string>("Arial", "Helvetica"));
loadOptions.FontSubstitutes.Add(new KeyValuePair<string, string>("Harriet", "Transcript"));
var saveOptions = new PdfSaveOptions();
var convertedDocument = conversionHandler.Convert(source, loadOptions, saveOptions);
convertedDocument.Save("result");
...

Set default font when converting from Diagram

/// <summary>
/// Diagram document load options
/// </summary>
public class DiagramLoadOptions: LoadOptions
{
    /// <summary>
    /// Default font for Diagram document. The following font will be used if a font is missing.
    /// </summary>
    public string DefaultFont { get; set; }
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.vsd";
var loadOptions = new DiagramLoadOptions
{
    DefaultFont = "Helvetica",
};
var saveOptions = new PdfSaveOptions();
var convertedDocument = conversionHandler.Convert(source, loadOptions, saveOptions);
convertedDocument.Save("result");
...

Set default font when converting Psd, Emf, Wmf documents

/// <summary>
/// Image document load options
/// </summary>
public class ImageLoadOptions
{
    /// <summary>
    /// Default font for Psd, Emf, Wmf document types. The following font will be used if a font is missing.
    /// </summary>
    public string DefaultFont { get; set; }
}

Usage

...
var config = new ConversionConfig();
var conversionHandler = new ConversionHandler(config);
const string source = "source.psd";
var loadOptions = new ImageLoadOptions
{
    DefaultFont = "Helvetica",
};
var saveOptions = new PdfSaveOptions();
var convertedDocument = conversionHandler.Convert(source, loadOptions, saveOptions);
convertedDocument.Save("result"); 
...