Change Target File Format using GroupDocs.Assembly for .NET 18.9

We are delighted to announce a powerful new feature in the monthly release of GroupDocs.Assembly for .NET 18.9. Using the latest version,  you can now change the target file format of an assembled document using file extension or explicit specification. You can change the target file format when assembling Word Processing, Spreadsheet, Presentation, Email and Text file formats. We recommend you to install and use the latest version of the API.

Features Introduced

Since version 18.9, you can change the format of the assembled document either by specification of the file extension or using LoadSaveOptions as shown in the following code snippets.

Changing the target file format using the file extension

DataSourceInfo dataSourceInfo = new DataSourceInfo(...);
DocumentAssembler assembler = new DocumentAssembler();
  
assembler.AssembleDocument("template.docx", "result.pdf", dataSourceInfo);

Changing target file format using explicit specification

Stream sourceStream = ...;
Stream targetStream = ...;
  
DataSourceInfo dataSourceInfo = new DataSourceInfo(...);
DocumentAssembler assembler = new DocumentAssembler();
  
assembler.AssembleDocument(sourceStream, targetStream, 
new LoadSaveOptions(FileFormat.Pdf), dataSourceInfo);

For more details on this feature, please visit this documentation article.

At the moment, GroupDocs.Assembly API provides the ability to change target file format when assembling the following file formats:

  • Word Processing documents
  • Spreadsheet documents
  • Presentation documents
  • Email documents
  • Text documents

Supported output file formats depending on input file formats can be found at this page.

API Changes

Newly Added Types

Following types are added in the latest version.

public class DataSourceInfo
public enum FileFormat
public class LoadSaveOptions

Newly Added Members of DocumentAssembler

Following members of DocumentAssembler are added in the latest version.

public void AssembleDocument(string sourcePath, string targetPath, params DataSourceInfo[] dataSourceInfos)
public void AssembleDocument(string sourcePath, string targetPath, LoadSaveOptions loadSaveOptions, params DataSourceInfo[] dataSourceInfos)
public void AssembleDocument(Stream sourceStream, Stream targetStream, params DataSourceInfo[] dataSourceInfos)
public void AssembleDocument(Stream sourceStream, Stream targetStream, LoadSaveOptions loadSaveOptions, params DataSourceInfo[] dataSourceInfos)

Removed Members of DocumentAssembler

Following members of DocumentAssembler are removed in the latest version.

public void AssembleDocument(string sourcePath, string targetPath, object dataSource)
public void AssembleDocument(string sourcePath, string targetPath, object dataSource, string dataSourceName)
public void AssembleDocument(string sourcePath, string targetPath, object[] dataSources, string[] dataSourceNames)
public void AssembleDocument(Stream sourceStream, Stream targetStream, object dataSource)
public void AssembleDocument(Stream sourceStream, Stream targetStream, object dataSource, string dataSourceName)
public void AssembleDocument(Stream sourceStream, Stream targetStream, object[] dataSources, string[] dataSourceNames)

Breaking Changes

Removed members of DocumentAssembler are replaced with new ones. Removed members were not marked as obsolete (deprecated) before removal as usual, because this would complicate migration to new members of DocumentAssembler in Java. Thus, we have introduced a breaking change and customers need to migrate their code from removed members of DocumentAssembler to newly added ones when upgrading to the new version of GroupDocs.Assembly.
For more details, please visit this documentation article.

Available Channels and Resources

Here are a few channels and resources for you to download, learn, try and get technical support on GroupDocs.Assembly for .NET.

Feedback

As always, if you have some questions, queries or suggestions about GroupDocs.Assembly for .NET API,  just share with us by creating a forum thread.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

To keep up with our news, you can follow us on Twitter or follow our Facebook page.