Home | About us | Overview | Softwares - Downloads | Evaluate | Order | Support | old forums | Contact | F.A.Q. | Documentations | Search | Sitemap

PDF Compression

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

PDF Compression

Postby dbarry » Wed Jul 09, 2008 11:32 pm

Hi Loic,

I have some problem with the file size of pdfs being too large. If I optimize in Acrobat the file size decreases almost 80%. I am using the code below to create them. I've noticed there is a PDFSetCompressionLevel method but it only works with PDFnewPDF. I am having issues converting this code to use PDFnewPDF with the PDFSetCompressionLevel. Can you give me an assist?

Code: Select all
If Imaging1.TwainOpenDefaultSource() Then
         Imaging1.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
         Imaging1.TwainSetAutoScan(True) 'To  achieve the maximum scanning rate
         Imaging1.TwainSetCurrentResolution(300)
         Imaging1.TwainSetCurrentPixelType(GdPicturePro5.TwainPixelType.TWPT_RGB) 'RGB
         Imaging1.TwainSetCurrentBitDepth(8) ' 24 bpp
         Imaging1.TwainPdfStart("output.pdf")
         Imaging1.CreateImageFromTwain(Me.Handle.ToInt32)
         nImageID = Imaging1.GetNativeImage
         Call Imaging1.TwainAddGdPictureImageToPdf(nImageID)
         Imaging1.CloseImage(nImageID)
         Imaging1.TwainPdfStop()
         Call Imaging1.TwainCloseSource()
         MsgBox("Done !")
      Else
         MsgBox("can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState)))
      End If


Thank You!
dbarry
 
Posts: 6
Joined: Thu May 29, 2008 5:56 pm

Re: PDF Compression

Postby dbarry » Mon Jul 14, 2008 10:47 pm

Hi Loic,

Just wondering if you had a chance to create some sample code as described above?

Thanks again!
dbarry
 
Posts: 6
Joined: Thu May 29, 2008 5:56 pm

Re: PDF Compression

Postby Loïc » Mon Jul 14, 2008 11:01 pm

HI,

I am on this problem!

I give you a full answer tomorow.

Best regards,

Loïc
User avatar
Loïc
Site Admin
 
Posts: 1486
Joined: Tue Oct 17, 2006 11:48 pm
Location: France

Re: PDF Compression

Postby Loïc » Tue Jul 15, 2008 6:41 pm

Hi,

First,

the PdfSetCompressionLevel() has not effect on 16, 24 & 32 bpp image compression. In your code you are acquiring 24 bpp image.

The compression used for true color image inside PDF are JPEG using high quality mode (jpeg compression set to 90).

In the next release, I will add a method to control the jpeg compression in order to decrease the file size.

Today, I can suggest you to try to convert your image to 8bpp using the ConvertTo8bppQ() method before adding the image to the PDF.

Best regards,

Loïc Carrère
User avatar
Loïc
Site Admin
 
Posts: 1486
Joined: Tue Oct 17, 2006 11:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 0 guests