compression while converting tiffs to pdf

Discussions about PDF management.
Post Reply
charuvas1
Posts: 38
Joined: Tue Dec 02, 2008 1:49 pm

compression while converting tiffs to pdf

Post by charuvas1 » Mon Aug 17, 2009 3:02 pm

Hi,

I am trying to convert multiple single page tiffs to one multi page pdf file. The tiffs are scanned and I have to maintain the dpi of the tiff images while converting them to pdf. Is there a way of doing so? Which compression is used for images while converting to pdf? Following is the code-

Code: Select all

Dim dr As New System.IO.DirectoryInfo(System.IO.Path.GetTempPath & "Scanner_sample")
            Dim fl As System.IO.FileInfo() = dr.GetFiles()
            Dim imgcnt As Integer
            Dim pdfid As Integer = oGdPictureImaging.PdfNewPdf(System.IO.Path.GetTempPath & "Scanner_sample\Multipg_pdf.pdf", "charu", "charu", "charu", "charu", "charu")
            For Each fl1 As System.IO.FileInfo In fl
                oGdPictureImaging.TiffOpenMultiPageForWrite(True)
                Dim m_img As Integer = oGdPictureImaging.CreateGdPictureImageFromFile(fl1.FullName)
                If m_img <> 0 Then
                     imgcnt = oGdPictureImaging.PdfAddImageFromGdPictureImage(pdfid, m_img) 
                end if
                    oGdPictureImaging.ReleaseGdPictureImage(m_img)
             next
      For i As Integer = 1 To imgcnt
                oGdPictureImaging.PdfNewPage(pdfid, oGdPictureImaging.PdfGetImageWidth(pdfid, i), oGdPictureImaging.PdfGetImageHeight(pdfid, i))
                Call oGdPictureImaging.PdfDrawImage(pdfid, i, 0, 0, oGdPictureImaging.PdfGetImageWidth(pdfid, i), oGdPictureImaging.PdfGetImageHeight(pdfid, i))
            Next
            oGdPictureImaging.PdfEndPdf(pdfid)
Your quick response would be highly appreciated.

Thanks
Charu

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: compression while converting tiffs to pdf

Post by Loïc » Wed Aug 19, 2009 10:26 am

Hi,

Code: Select all

The tiffs are scanned and I have to maintain the dpi of the tiff images while converting them to pdf. Is there a way of doing so? 
This is done automatically when you add a GdPicture image to a PDF.

Code: Select all

Which compression is used for images while converting to pdf? 
CCITT4 for bitonal images, JPEG for color an 8bit grayscale image, else Flate compression.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest