I'm having an issue where rather small tiff files (< 300 KB) gets blown up to like 74 MB when converted into a PDF.
using (var img_collection = new MagickImageCollection())
{
using (var tif_collection = new MagickImageCollection(Convert.FromBase64String(base64_string_of_tif_image), MagickFormat.Tif))
{
foreach (MagickImage tif in tif_collection)
{
img_collection.Add(new MagickImage(tif.ToByteArray())
{
Format = MagickFormat.Pdf
});
}
tif_collection.Dispose();
}
img_collection.Write("output.pdf", MagickFormat.Pdf);
img_collection.Dispose();
}
Any ideas as to how I can prevent that from happening? The tif files are actually just scans of text.