I search a way to convert a Group 3 compressed TIFF to png or for best in pdf with c#.net.
4 Answers
TIFF to PNG:
System.Drawing.Image will allow you to open a Group3 TIFF and save it as PNG simply by loading the TIFF as a normal image (e.g. Image.FromFile, Image.FromStream, etc.) and then saving it using the Image.Save method with the ImageFormat.Png argument. As TIFFs vary widely, on occasion I have encountered an obscure TIFF that System.Drawing won't open, but that is unusual. If it happens, you'll need to seek out a third party library from opensource (e.g. iText has a sophisticated image library) or there are commercial options such as Lead Tools or Atalasoft.
TIFF to PDF:
iTextSharp is a great library for doing this. I even found some articles on this specific topic with a google search. This one seems to be a good one to start with for your needs.

- 8,884
- 1
- 40
- 52
Try LibTiff.Net library for this.
The library comes with tiff2pdf utility (you would need to build it yourselves) that probably does exactly what you need. You may even incorporate the code of the utility in your application.
The library and utility are free and open-source. License (New BSD License) allows any modifications. You can use the library and utility in commercial applications.
Disclaimer: I am one of the maintainers of the library.

- 13,789
- 19
- 80
- 130
(disclaimer - I work for Atalasoft) If you use dotImage for this, both conversions are trivial.
for tiff to pdf:
using (outputStream = new FileStream(pathToPdf, FileMode.Create)) {
PdfEncoder encoder = new PdfEncoder();
encoder.Save(outputStream, new FileSystemImageSource(pathToTiff, true), null); // true = do all pages
}
for tiff to png:
FileSystemImageSource source = new FileSystemImageSource(pathToTiff, true);
int page = 0;
while (source.HasMoreImages()) {
AtalaImage image = source[page];
using (FileStream stm = new FileStream("output_page_" + page + ".png", FileMode.Create)) {
PngEncoder encoder = new PngEncoder();
encoder.Save(stm, image, null);
}
source.Release(image);
}

- 48,267
- 11
- 78
- 120
Use ghostscript, i used to extract images from a PDF and create thumbnails, the lib also convert from images to PDF and it's open source.
A guy create a wrapper for the ghostscript API: http://www.mattephraim.com/blog/2009/01/06/a-simple-c-wrapper-for-ghostscript/

- 302
- 2
- 3