TIF to PDF creates large PDF file

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

Moderators: XnTriq, xnview

Post Reply
vickilr0ss
Posts: 4
Joined: Wed Jun 17, 2015 3:58 pm

TIF to PDF creates large PDF file

Post by vickilr0ss » Wed Jun 17, 2015 4:22 pm

I am using the 6.56 version of nconvert to convert TIFs to PDF - occasional the PDF will be very large. I have seen a 9 MB file converted into a 96 MB PDF file. An ASP program runs a WSHshell command to execute the nconvert command. This is the command line:

WshShell.Run "c:\\windows\\system32\\nconvert.exe -multi -out pdf -c 5 -o """& TIFPath&"\"&filename2&""" """& TIFPath&"\"&filename&""

Three sets of quotes are used to manage the spaces in the file name.

I downloaded the 6.7 version of nconvert and now I can not get it to work -no errors - it just hangs. When I run the nconvert at the cmd line, the file is converted but since I need to convert sometimes hundreds of files a day, I use an ASP program. I can not use a .bat file since a database is used in the logic.

Any insight to these two problems.

User avatar
xnview
Author of XnView
Posts: 32704
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: TIF to PDF creates large PDF file

Post by xnview » Thu Jun 18, 2015 8:28 am

vickilr0ss wrote:I am using the 6.56 version of nconvert to convert TIFs to PDF - occasional the PDF will be very large. I have seen a 9 MB file converted into a 96 MB PDF file. An ASP program runs a WSHshell command to execute the nconvert command. This is the command line:

WshShell.Run "c:\\windows\\system32\\nconvert.exe -multi -out pdf -c 5 -o """& TIFPath&"\"&filename2&""" """& TIFPath&"\"&filename&""
And what the size pixels of your input file?
I downloaded the 6.7 version of nconvert and now I can not get it to work -no errors - it just hangs. When I run the nconvert at the cmd line, the file is converted but since I need to convert sometimes hundreds of files a day, I use an ASP program. I can not use a .bat file since a database is used in the logic.
Strange if it works in command line. No memory problem?
Pierre.

vickilr0ss
Posts: 4
Joined: Wed Jun 17, 2015 3:58 pm

Re: TIF to PDF creates large PDF file

Post by vickilr0ss » Thu Jun 18, 2015 2:31 pm

Dimensions are 2550*3300 pixels 96dpi

No memory problems that I know of.

Unfortunately, I can not send you any files since the information is confidential.

Thx for your help

User avatar
xnview
Author of XnView
Posts: 32704
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: TIF to PDF creates large PDF file

Post by xnview » Fri Jun 19, 2015 8:31 am

no error? no message?
Pierre.

vickilr0ss
Posts: 4
Joined: Wed Jun 17, 2015 3:58 pm

Re: TIF to PDF creates large PDF file

Post by vickilr0ss » Wed Jun 24, 2015 7:49 pm

No error message - it just hangs.

User avatar
xnview
Author of XnView
Posts: 32704
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: TIF to PDF creates large PDF file

Post by xnview » Thu Jun 25, 2015 4:17 am

vickilr0ss wrote:No error message - it just hangs.
and no problem with previous version?
Pierre.

vickilr0ss
Posts: 4
Joined: Wed Jun 17, 2015 3:58 pm

Re: TIF to PDF creates large PDF file

Post by vickilr0ss » Wed Jul 08, 2015 2:18 pm

Sorry I did not reply sooner - I had to put this aside to finish some other projects. I can not get the new 6.7 version to work - the old version works but creates huge files, not all the time, just some of the time. I created a text file to log these just to see how wide spread the problem is. It's pretty bad and I don't know when the problem started or if it has been a problem since day one. I was hoping the new version would clear up the sizing up problem but I just haven't had time to work on it.

Thanks for your help. Once I start working on this again, I let you know if I find anything.

KenJRay
Posts: 3
Joined: Mon Feb 22, 2016 2:44 pm

Re: TIF to PDF creates large PDF file

Post by KenJRay » Tue Feb 23, 2016 2:30 pm

I am having the same problem - nConvert version 6.82 running on Window Server 2008R2. I start with a multipage TIFF file, just over 1MB in size. Using the command

C:\Program Files\NConvert-win64>nconvert -o test.pdf -out pdf f40baef8-4245-42c5-bf1e-a30b717bc5d1.tif

The resulting PDF file is over 69MB, which is unacceptably large.

What I am trying to do is in a web based court document inquiry system, produce copies of the documents (that for some reason unknown, are stored in TIFF format) that can be view in a browser. Sure, there are ways to view TIFF files in a browser, but there are problems for Apple Mac users (QuickTime barfs at multipage tiff documents, and you can bet that 99% of all filed court documents have more than one page). Ideally, I would love to have a conversion that would OCR the TIFF document, and produce the resulting PDF document as a text document, and not a (huge) image document.

Any ideas or suggestions would be greatly appreciated.

cday
XnThusiast
Posts: 2314
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: TIF to PDF creates large PDF file

Post by cday » Tue Feb 23, 2016 3:24 pm

KenJRay wrote:I am having the same problem - nConvert version 6.82 running on Window Server 2008R2. I start with a multipage TIFF file, just over 1MB in size. Using the command

Code: Select all

C:\Program Files\NConvert-win64>nconvert -o test.pdf -out pdf f40baef8-4245-42c5-bf1e-a30b717bc5d1.tif
The resulting PDF file is over 69MB, which is unacceptably large.
Your code doesn't include a compression term, so the resulting files are uncompressed...

Code: Select all

-c value          : Compression number (default : 0)
              PDF    : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
Depending on the bit-depth (black and white, grayscale or colour) of the source files, one or other of the above compression options should produce the minimum file size, all options but JPEG are lossless. If the source documents are black and white Fax compression should produce gratifyingly small files without any loss of quality; for grayscale or colour documents JPEG should produce small files if you use a quality setting that gives acceptable quality:

Code: Select all

-q value          : JPEG/PNG/FPX/WIC/PDF quality (default : 100)
Ideally, I would love to have a conversion that would OCR the TIFF document, and produce the resulting PDF document as a text document, and not a (huge) image document.
Adobe Acrobat, Abbyy FineReader or Nuance Omnipage can do that, but for a vector text file rather than a searchable-image file Adobe Acrobat ClearScan would probably be the safest option, if it is important to preserve the page layout and you wish to avoid proof-reading, although ClearScan can at least theoretically introduce typos in some circumstances, which might be a consideration. Any of those commercial programs can produce a searchable-image file satisfactorily, and with suitable compression file size shouldn't be a serious issue. Batch conversions would probably require the higher-priced versions, though.

KenJRay
Posts: 3
Joined: Mon Feb 22, 2016 2:44 pm

Re: TIF to PDF creates large PDF file

Post by KenJRay » Tue Feb 23, 2016 3:45 pm

Thanks - the -c 1 option worked perfectly.

cday
XnThusiast
Posts: 2314
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: TIF to PDF creates large PDF file

Post by cday » Tue Feb 23, 2016 6:24 pm

KenJRay wrote:Thanks - the -c 1 option worked perfectly.
What file size did your original 69MB PDF reduce to with Fax compression, out of interest?
KenJRay wrote:... you can bet that 99% of all filed court documents have more than one page...
To process multi-page files, you will need to add a -multi term to your code otherwise only the first page of the TIFF will be saved:

Code: Select all

-multi            : Create a multi-page (TIFF/DCX/LDF/PDF only)
So:

Code: Select all

nconvert -out pdf -multi -o Output.pdf M-TIFF.tif
PDF compression term omitted for clarity.

Post Reply