I noticed in some old code on the forum:
Set MyTiffObj = Server.CreateObject( "DynamicPDF.TiffFile" )
MyTiffObj.LoadTiff( Server.MapPath( "Images/fw9_03.tif" ) )
Set MyImage = MyTiffObj.GetImage(1)
I'm developing a Desktop app, not Web. The new ceTe.DynamicPDF.Imaging.TiffFile class does not have the GetImage method? I noticed it has an Images collection, but this returns a TiffImageData object. I'm trying to gain access to the images from a multi-page Tiff file for thumbnail generation. I don't want to create a PDF document. Is there a way to iterate on the collection and retrieve the images?
TiffFile tFile = new TiffFile(file);
TiffImageData tid = tFile.Images[0];
TiffFile.GetImage(i)
Re: TiffFile.GetImage(i)
Support · May 23, 2017Hello,
The TiffImage class in the DynamicPDF API is designed to create PDF out of Tiff images. It is not possible to get the individual images from the multipage tiff image using DynamicPDF Generator for .NET API.
You can achieve your requirements by using combination of DynamicPDF Generator for .NET and DynamicPDF Rasterizer for .NET product. You will need to create multipage PDF using Tiff image using DynamicPDF Generator for .NET product and then convert this multipage PDF to individual supported image formats
using DynamicPDF Rasterizer product. Below is the code sample.
//Code sample to create PDF out of multipage Tiff image using DynamicPDF Generator API.
TiffFile tifObj = new TiffFile(@"Path of a Tiff image file");
Document document = tifObj.GetDocument();
byte[] pdfData = document.Draw();
//Creating individual images from PDF using DynamicPDF Rasterizer API.
ceTe.DynamicPDF.Rasterizer.InputPdf pdf = new ceTe.DynamicPDF.Rasterizer.InputPdf(pdfData);
PdfRasterizer rastObj = new PdfRasterizer(pdf);
TiffImageFormat tiffImageFormat = new TiffImageFormat(TiffColorFormat.Rgb);
for (int i = 0; i < rastObj.Pages.Count; i++)
{
PdfRasterizerPage page = rastObj.Pages[i];
//Saving the image to disk.
page.Draw(@"E:\Temp\Rast\Output"+ (i+1)+".tif", tiffImageFormat, ImageSize.Dpi72);
//Outputing the image into byte array.
byte[] imageByteData = page.Draw(tiffImageFormat, ImageSize.Dpi72);
page.Dispose();
}
rastObj.Dispose();
pdf.Dispose();
You can download fully functional evaluation edition of DynamicPDF Generator for .NET product here
. Also refer to the documentation on referencing assembly here
.
You can download evaluation edition of DynamicPDF Rasterizer for .NET product here
. Also refer to the documentation on referencing assembly here
and help topic on deployment here
.
Thanks,
ceTe Software Support Team
Re: TiffFile.GetImage(i)
Forum member · May 23, 2017Ok does the Converter DLL provide this ability, and if so, is it just doing the same 2 step conversion? 1. Multi-page Tiff to Multi-page PDF, 2. Rasterize
thanks
Re: TiffFile.GetImage(i)
Support · May 23, 2017Hello,
No, Converter does not offer the capability you are looking for. Converter can only convert a multipage TIFF to multipage PDF.
Thanks,
ceTe Software Support Team