How to decrease the size of generated PDF files?

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, xnview

Post Reply
User avatar
Farbauti
Posts: 14
Joined: Tue Aug 24, 2010 8:30 am
Location: Munich, Germany

How to decrease the size of generated PDF files?

Post by Farbauti »

Hello,

I need to convert multiple (1-4) TIFs into one PDF file.
I thought nconvert were the best tool for that task, but found the resulting PDFs are humongous.
E.g.:

Code: Select all

10.12.2020  16:56    <DIR>          .
10.12.2020  16:56    <DIR>          ..
10.12.2020  16:56        84.979.261 24043189.pdf
20.08.2020  13:16            49.916 24043189_001.tif
20.08.2020  13:16            18.937 24043189_002.tif
10.12.2020  16:56        77.352.869 24978935.pdf
20.08.2020  13:31            49.210 24978935_001.tif
20.08.2020  13:31            45.118 24978935_002.tif
10.12.2020  16:56        78.914.817 27674146.pdf
20.08.2020  14:51            49.709 27674146_001.tif
20.08.2020  14:51            45.898 27674146_002.tif
10.12.2020  16:56       157.894.669 27674157.pdf
20.08.2020  14:51            53.599 27674157_001.tif
20.08.2020  14:51            73.431 27674157_002.tif
20.08.2020  14:51            55.416 27674157_003.tif
20.08.2020  14:51            13.466 27674157_004.tif
As you see each PDF file is about 1000 times bigger than the TIFs combined.
I used the following options:

Code: Select all

-xall -multi -out pdf
What do I do wrong here?

Cheers, Farbauti.
User avatar
Farbauti
Posts: 14
Joined: Tue Aug 24, 2010 8:30 am
Location: Munich, Germany

Re: Are there any options to decrease the size of generated PDF files?

Post by Farbauti »

I forgot:
I upgraded to the latest version, and this also generates the huge PFDs.
NCONVERT v7.60 (c) 1991-2019 Pierre-E Gougelet (Oct 15 2020/10:54:16) **
Version for Windows Xp/Vista/7 x64 (All rights reserved)
cday
XnThusiast
Posts: 2907
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Are there any options to decrease the size of generated PDF files?

Post by cday »

For PDF output compression options please check the Help file, the following options are for NConvert 7.39:

Code: Select all

-c value     : Compression number
               default : 0 (uncompressed)
               PDF    : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
If your images are black and white, Fax normally provides very good compression and is lossless, for grayscale or colour images when file size is important JPEG is normally the best option, and you can set the compression level using the -q switch:

Code: Select all

 -q value     : JPEG/FPX/WIC/PDF quality (default : 85)
User avatar
Farbauti
Posts: 14
Joined: Tue Aug 24, 2010 8:30 am
Location: Munich, Germany

Re: Are there any options to decrease the size of generated PDF files?

Post by Farbauti »

cday wrote: Thu Dec 10, 2020 4:33 pm

Code: Select all

-c value     : Compression number
               default : 0 (uncompressed)
               PDF    : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
Thanks! That was exactly what I was looking for.
You are the best :)

cheers
Post Reply