Using Atalasoft DotImage to create blank Tiff image
Atalasoft DotImage is a great library for working with all kinds of images. I recently had the need for a Tiff image which met the following specification:
- 300 x 300 dpi
- Print at regular letter size (8 1/2 x 11)
- Encoded using Group 4 compression
I created this Tiff file using only the following 5 lines of code:
AtalaImage atalaImage = new AtalaImage(2550, 3263, PixelFormat.Pixel1bppIndexed); atalaImage.Resolution = new Dpi(300, 300, ResolutionUnit.DotsPerInch); TiffDocument testDoc = new TiffDocument(); testDoc.Pages.Add(new TiffPage(atalaImage, TiffCompression.Group4FaxEncoding)); testDoc.Save(YOUR_LOCATION);
Prior to using this code I had simply scanned a blank sheet. I quickly realized this was not a good alternative due to inconsistencies with the scanner bed. Using this simple code I created a perfect Tiff.