Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need .NET library fo converting TIFF files to PDF [closed]

Tags:

.net

pdf

tiff

Does anyone know of a good .NET library to convert TIFF files, that may be multi-page, to PDF files?

The TIFF files are stored on a file share, and the PDF files need to be stored in the same location as the TIFF file.

The tool is supposed to be used for converting high volumes of TIFF files.

like image 505
Palle Agermark Avatar asked Aug 24 '10 11:08

Palle Agermark


1 Answers

Here is an example using PDFSharp

using System;
using System.Collections.Generic;
using System.Text;
using PdfSharp.Drawing;
using PdfSharp.Pdf;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            PdfDocument s_document = new PdfDocument();

            PdfPage page = s_document.AddPage();

            XGraphics gfx = XGraphics.FromPdfPage(page);


            XImage image = XImage.FromFile(@"C:\Image.tif");

            page.Width = image.PointWidth;
            page.Height = image.PointHeight;

            gfx.DrawImage(image, 0, 0);

            s_document.Save(@"C:\Doc.pdf");
        }
    }
}
like image 134
Peter Hammersmith Avatar answered Oct 08 '22 17:10

Peter Hammersmith