TiffFile object to file

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  Re: TiffFile object to file

DynamicPDF CoreSuite for .NET (v10) Forum

 Jun 19 2020 6:19 PM
Hi,

Is there a way to write TIFFFile object to .tif file using byte[] or any stream?

Thank you!
 Jun 22 2020 11:05 AM
Posted by a ceTe Software moderator
Hi,

The TiffFile object is used for opening a TIFF image and outputting it as PDF. You can load a TIFF from a byte array, stream or file and output the PDF as a byte array, stream or file. This can all be done in memory. Here is an example using a byte array:

    // Read a TIFF from a byte array
    byte[] inputByteData = File.ReadAllBytes(@"Input TIFF file path");
    TiffFile tiffFile = new TiffFile(inputByteData);
    Document document = tiffFile.GetDocument();
    // Output the PDF as a byte array
    byte[] outputByteData = document.Draw();

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 3:48 PM.