I ran into a situation where I had to reduce the size of my tiff image when converting to pdf. I used the code below.
using System;
using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Tiff;
using Aspose.Imaging.ImageOptions;
namespace TestImaging
{
public class TiffToPDF
{
public static void ConvertTiffToPDF()
{
// Applying product license to convert Tiff to PDF in C#
License TiffToPdfLicense = new License();
TiffToPdfLicense.SetLicense("Aspose.Total.lic");
using (Image TifImage = Image.Load("Original.tif"))
{
TiffImage tiffImage = (TiffImage)TifImage;
PdfOptions pdfOptions = new PdfOptions()
{
ResolutionSettings = new ResolutionSetting(
tiffImage.HorizontalResolution, tiffImage.VerticalResolution
)
};
TifImage.Save("ExportedTiff.pdf", pdfOptions);
}
}
}
}
TifImage.Save() caused a major memory leak in my application.
Sharing this info incase anyone else runs into this issue.
Source: How to Convert TIFF to PDF in C#