PDF File size too large 44pages = 33MB

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
dawa
Posts: 18
Joined: Wed Sep 07 2005

PDF File size too large 44pages = 33MB

Post by dawa »

Hi all,

I've got a PDF Converter Version 2.05 Professional.

I am printing a report from Visual Foxpro 9.0 to using the printer. It prints but the resulting PDF is more 33M. It have about 46 pages, among them 44 are TIFs and 2 of them are JPGs.
I've tried many settings.
Below is the latest code that I am testing with:

Code: Select all


#define FileNameOption_NoPrompte  0x00000001                     && do not prompt for file name
#define FileNameOption_UseFileName  0x00000002                   && use file name set by SetDefaultFileName else use document name
#define FileNameOption_JPegLevelLow  0x00020000                  && Low JPeg compression

m.loPdf = CREATEOBJECT("cdintf.cdintf")
m.loPdf.DriverInit("PDF Converter")
m.loPdf.FileNameOptionsEx = FileNameOption_NoPrompte ;
                  + FileNameOption_UseFileName ;
                  + FileNameOption_JPegLevelLow
SET PRINTER TO NAME ("PDF Converter")
REPORT FORM rptimagereport.frx NOEJECT NOCONSOLE TO PRINTER
m.loPDF.DriverEnd()
then Joan of Amyuni Team suggested "that you try CCITT fax Compression algorithm, if they are colored I suggest that you try Automatic Compression algorithm"

Well, I've tried to use Automatic Compression as the following block of code shows:
Code:

Code: Select all

m.loPdf.FileNameOptionsEx = FileNameOption_NoPrompte ;
                  + FileNameOption_UseFileName ;
                  + FileNameOption_AutoCompression
But I get this error:
[error]
8002000a: Out of present range.
[/error]

Then, I converted all the TIFF images to JPEG format then used JPEGLow compression the size got reduced only by 1M from it's original 33M.

Code: Select all

m.loPdf.FileNameOptionsEx = FileNameOption_NoPrompte ;
                  + FileNameOption_UseFileName ;
                  + FileNameOption_JPegLevelLow
[code]

Why is this happening?

When I have mixed image types such as TIFF and JPEG, what is best compression to use? Will Automatic Compression compress both of the types?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Dawa,

Please don't cross post your question.

When you have different images type in one document the best is to use Automatic Compression, it will find the best compression algorith for each image and use it.

Please try to use the following call to FileNameOptionsEx (I replaced the hexadecimal values by the corresponding decimal ones):

m.loPdf.FileNameOptionsEx = 1+ 2 + 2147483648

I hope this helps.
dawa
Posts: 18
Joined: Wed Sep 07 2005

Post by dawa »

Joan,

Sorry about the cross posting! When I didn't get a reply for two days in a forum, I considered it lost. That's I reposted.

Anyway, the setting you suggested which is the following:

Code: Select all

m.loPdf.FileNameOptionsEx = 1+ 2 + 2147483648
I still get the same error message which is:
---------------------------
---------------------------
Error #:1426
Message: OLE error code 0x8002000a: Out of present range.

Detail: 8002000a: Out of present range

Line#: 73

Line Contents: m.loPdf.FileNameOptionsEx = 1+ 2 + 2147483648
---------------------------
---------------------------
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

I will check this issue with our Developers and let you know.
dawa
Posts: 18
Joined: Wed Sep 07 2005

Post by dawa »

Any word from your developers?
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

In order to add the AutoCompression parameter to the .FileNameOptionsEx() functions you should use the value below.

#define FileNameOption_AutoCompression -2147483648 && activate automatic image compression


Hope this helps?
dawa
Posts: 18
Joined: Wed Sep 07 2005

Post by dawa »

Jose,

Thanks for the reply.

Did you get my email from yesterday? If not, I've also posted it here. Under the topic: "Inconsistency with JPEG Compression settings?"

I've tried what you've suggested. Anyway, you'll see the details in the email.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

This issue was solved long time ago.

I am adding this note only for users who may encounter the same issue:

You need to cast the value to a long by using something like:

m.loPdf.FileNameOptionsEx = (unsigned long) or (long)(1+ 2 + 2147483648)
Post Reply