How to Convert PowerPoint to Tiff using C#

This topic focuses on how to convert PowerPoint to TIFF using C# along with the detailed configuration steps to configure the environment and verify the working sample code. You can use this application in any of .NET supported environments in Windows, macOS and Linux to convert PPTX to TIFF in C#.

Steps to Convert PowerPoint to TIFF using C#

  1. Configure your application to install Aspose.Slides for .NET using the NuGet package manager
  2. Load the source presentation file using the Presentation class object to convert it to TIFF
  3. Initialize the TiffOptions class object to set the desired image options
  4. Set the DPI and size for the desired TIFF image
  5. Convert the presentation to a TIFF image using the Save method

The aforementioned steps convert the presentation to TIFF in C# by using a few API calls only where the process is initiated by loading the source presentation file using the Presentation class. Then by using the TiffOptions class instance, the output TIFF image options including DPI and image size are set before saving the presentation as a TIFF image on the disk using the Save method.

Code to Convert PPTX to TIFF in C#

using System;
using System.Drawing;
using Aspose.Slides;
using Aspose.Slides.Export;
namespace TestSlides
{
public class PresentationToTiffConverter
{
public static void CreateTiffImage()
{
// Initialize a license to avoid watermark in the output Tiff Image
Aspose.Slides.License licenseSlides = new Aspose.Slides.License();
licenseSlides.SetLicense("Aspose.Total.lic");
// Initliazing the Presentation class to load the source presentation and converting to Tiff
using (Presentation SampleTiffPres = new Presentation("NewPresentation.pptx"))
{
// Initialize the TiffOptions class
TiffOptions tiffOptions = new TiffOptions();
// Setting the Tiff compression type
tiffOptions.CompressionType = TiffCompressionTypes.Default;
// Customizing the slides notes option inside exported Tiff
INotesCommentsLayoutingOptions notesOptions = tiffOptions.NotesCommentsLayouting;
notesOptions.NotesPosition = NotesPositions.BottomFull;
// Setting the Tiff image DPI. The resolution unit is always equal to 2-dots per inch
tiffOptions.DpiX = 200;
tiffOptions.DpiY = 100;
// Set the desired Tiff output Image Size
tiffOptions.ImageSize = new Size(1728, 1078);
// Save the source presentation to Tiff with set image size
SampleTiffPres.Save("ExpoertedTiff_out.tiff", SaveFormat.Tiff, tiffOptions);
}
}
}
}

The above example can also be used for converting PPT to TIFF in C# using the same code base. The TiffOptions class can further customize the output TIFF by exposing the options like setting CompressionType, PixelFormat, ShowHiddenSlides and NotesCommentsLayouting. The above application can seamlessly convert PPTX to TIFF without installing MS PowerPoint or any other third-party tool.

In this tutorial, we learnt to generate TIFF from PowerPoint in C# by performing simple steps and using a simple API interface. If you are interested in creating the presentation slide images, refer to the article on how to create PowerPoint slide image using C#.

 English