Tiff to pdf Issue -> file size increasing drastically

I am using Aspose.Imaging for tiff to pdf file conversion but after conversion file size increases drastically. Currently we are using Active pdf and trying to replace with Aspose. If we can’t resolve this then it will be difficult to move with aspose.

Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = null;
tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(inputPath);
if (tiffImage == null)
throw new Exception("Cannot load file - " + inputPath);

Aspose.Imaging.ImageOptions.PdfOptions pdfOptions = new Aspose.Imaging.ImageOptions.PdfOptions()
{
ResolutionSettings = new Aspose.Imaging.ResolutionSetting(
tiffImage.HorizontalResolution,
tiffImage.VerticalResolution)
};
tiffImage.Save(outputPDF, pdfOptions);

@sranjan50,
You may please share your sample TIFF file for our testing. We will reproduce the issue here and share our feedback accordingly.

FX8C0D04a80.zip (152.6 KB)
FX8C0D04a80.pdf (361.5 KB)

Please find the attached zip folder which contains tiff and converted pdf file. Converted pdf size is 9 time larger than original file size,

@sranjan50

Can you please share the information which product version you have used on your end. If you are using any older version then please try using the latest Aspose.Imaging for .NET 21.9 on your end.

version is 21.7

@venkatmallu

I have created a ticket with ID IMAGINGNET-4834 in our issue tracking system to further investigate the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be fixed,

Was this issue resolved? I have similar issue

Hello, @njjudiciary,
if you want to decrease the output PDF size, you should try to specify compression options when exporting. For example,

        using (var image = Image.Load(@"input.tiff"))
        {
            var pdfOptions = new PdfOptions()
            {
                PdfCoreOptions = new PdfCoreOptions()
                {
                    // setting compression options
                    Compression = PdfImageCompressionOptions.Ccitt4,
                }
            };
            image.Save(@"output.pdf", pdfOptions);
        }

Hope this helps!

1 Like