GroupDocs.Conversion for .NET 17.7.0 Release Notes

Major Features

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

  • Returning available layouts for a CAD document
  • Option to hide PDF annotations when converting from PDF
  • Option to specify exact layout to convert from a CAD document
  • Option to specify Width and Height for the result document when converting From CAD document

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
CONVERSIONNET-1968Update DocumentInfo class to return all layouts for CAD document typesNew Feature
CONVERSIONNET-1969Implement possibility to convert specific layouts when converting from CAD documentNew Feature
CONVERSIONNET-1970Convert Pdf documents without annotationsNew Feature
CONVERSIONNET-1962Implement possibility to set Width and Height when converting from CAD documentImprovement

Public API and Backward Incompatible Changes

How to get available layouts in a CAD document

const string sourceFileName = "sample.dwg"; //TODO: Put the source filename here
// Setup Conversion configuration
var conversionConfig = new ConversionConfig
{
    CachePath = "cache",
    StoragePath = "."
};
var conversionHandler = new ConversionHandler(conversionConfig);
var result = conversionHandler.GetDocumentInfo(sourceFileName);
foreach (var layer in result.Layers)
{
    Console.WriteLine(layer);
}

How to convert specific layout from a CAD document

const string sourceFileName = "sample.dwg"; //TODO: Put the source filename here
// Setup Conversion configuration
var conversionConfig = new ConversionConfig
{
    CachePath = "cache",
    StoragePath = "."
};
var conversionHandler = new ConversionHandler(conversionConfig);
var options = new PdfSaveOptions
{
    OutputType = OutputType.String
};
options.CadOptions.LayoutNames = new[] {"layout-1"};
var result = conversionHandler.Convert<string>(sourceFileName, options);

How to set specific width and height for each layout from a CAD document

const string sourceFileName = "sample.dwg"; //TODO: Put the source filename here
// Setup Conversion configuration
var conversionConfig = new ConversionConfig
{
    CachePath = "cache",
    StoragePath = "."
};
var conversionHandler = new ConversionHandler(conversionConfig);
var options = new PdfSaveOptions
{
    OutputType = OutputType.String
};
options.CadOptions.Width = 800;
options.CadOptions.Height = 600;
var result = conversionHandler.Convert<string>(sourceFileName, options);

How to hide annotations when converting from PDF

const string sourceFileName = "sample.pdf"; //TODO: Put the source filename here
// Setup Conversion configuration
var conversionConfig = new ConversionConfig
{
    CachePath = "cache",
    StoragePath = "."
};
var conversionHandler = new ConversionHandler(conversionConfig);
var options = new WordsSaveOptions
{
    OutputType = OutputType.String,
    HidePdfAnnotations = true
};
var result = conversionHandler.Convert<string>(sourceFileName, options);