Subject: Created PDF With Images Bloated
Date: 2011-03-02 09:19:53
From: gary Lee
Source: created-pdf-images-bloated
----------------------------------------------------------------------

When I create a New PDF made purely of gif images, the PDF ends up bloated.
8 full size images, (GiF)
1 image per page.
Total Image size = 4.5MB
Total PDF size 18MB.

Anyone know why, or how to correct this.

My code is as follows:


Dim
ImageName As String = ""
Dim doc As New PdfDocument
Dim section As PdfSection = doc.Sections.Add()
Dim page As PdfPage = Nothing
Dim g As PdfGraphics = Nothing

    For x As Integer = 1 To 8

        ImageName =

"C:\temp\PDFMerge\TempJPG_000" & x & ".gif"

        Dim tiffImage As New PdfBitmap(ImageName)
        tiffImage.Quality = 0.5
        page = section.Pages.Add()
        section.PageSettings.Margins.All = 10
        g = page.Graphics
        tiffImage.ActiveFrame = 0
        g.DrawImage(tiffImage, 0, 0, page.GetClientSize().Width, page.GetClientSize().Height)
        tiffImage.Dispose()
    Next

doc.Save("C:\TestGary.pdf")
doc.Dispose()

Thanks

Gary ---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index