Upgrade pdf version! Is it possible?

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

Moderators: XnTriq, helmut, xnview

Testerr
Posts: 4
Joined: Sun Oct 01, 2017 2:57 pm

Upgrade pdf version! Is it possible?

Post by Testerr »

Hi everybody!
When I create pdf file from png pictures, I get pdf version 1.3 (Acrobat 4.x)
Is it possible upgrde pdf version to newer: 1.5-1.7 ??
User avatar
xnview
Author of XnView
Posts: 44761
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Upgrade pdf version! Is it possible?

Post by xnview »

why? is it a problem
Pierre.
Testerr
Posts: 4
Joined: Sun Oct 01, 2017 2:57 pm

Re: Upgrade pdf version! Is it possible?

Post by Testerr »

Difference in quality: I created 2 pdf files from one png file (see attachment):
used Adobe Transformer (adobe_lomonosov.pdf) and Nconvert (nconvert -out pdf -o "nc_lomonosov.pdf" "lomonosov.png")
The quality of the file adobe_lomonosov.pdf is better
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 4172
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Upgrade pdf version! Is it possible?

Post by cday »

Your command line:

Code: Select all

nconvert -out pdf -o "nc_lomonosov.pdf" "lomonosov.png"
... doesn't specifiy the type of compression to be used when the PDF file is created, if JPEG is the default (I don't know) that could affect the quality of the image in the file produced...

Code: Select all

-out format       : Output format name

-c value          : Compression number
              default : 0 (uncompressed)
              PDF    : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
              
-q value          : JPEG/FPX/WIC/PDF quality (default : 85)
A later PDF version wouldn't directly affect the image quality, although newer compression methods not currently supported by NConvert are available.
Testerr
Posts: 4
Joined: Sun Oct 01, 2017 2:57 pm

Re: Upgrade pdf version! Is it possible?

Post by Testerr »

Yes, you are right, a later PDF version wouldn't directly affect the image quality.
All difference is Antialias in Adobe Transformer pdf document. You can open two documents and see in 400% zoom.
Is it possible created pdf with Nconvert with Antialias like in Adobe Transformer?
cday
XnThusiast
Posts: 4172
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Upgrade pdf version! Is it possible?

Post by cday »

Testerr wrote:Yes, you are right, a later PDF version wouldn't directly affect the image quality.
All difference is Antialias in Adobe Transformer pdf document. You can open two documents and see in 400% zoom.
Is it possible created pdf with Nconvert with Antialias like in Adobe Transformer?
Isn't antialiase a viewer function, are you comparing the two output PDFs in the same PDF viwer?
Testerr
Posts: 4
Joined: Sun Oct 01, 2017 2:57 pm

Re: Upgrade pdf version! Is it possible?

Post by Testerr »

No, I find out that Adobe program use the PreciseScan technology from ABBYY smoothes pixelated characters on PDFs, thus improving the visual quality of documents for easier reading, archiving or better printing results.
Is it possible to apply some Nconvert filters to smooth images and get the same quality PDF file?
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 4172
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Upgrade pdf version! Is it possible?

Post by cday »

PreciseScan technology is, as you say, an ABBYY text rendering option, and one I hadn't heard of even though I have FineReader 12 installed...

From the description in the FineReader 12 user guide I'm wondering if it vectorises bitmap text the that way Adobe ClearScan does, which given a high enough resolution image, produces very high quality text which doesn't become pixelated even at high zoom values, very impressive when it works well, and also potentially much smaller file sizes. :D

Regarding NConvert, there are probably filters that might improve the image quality, for example Enhance focus if you check the help file, but if PreciseScan does vectorise the text you could never get quite that quality image.

Edit:

Looking at the FineReader 12 user manual a bit more, it refers to PreciseScan as reducing pixelation, so it is likely is a filter rather than a vectorisation process; some scanner software, for instance Epson, also offers a text enhancement option which is clearly some kind of filter.
User avatar
XnTriq
Moderator & Librarian
Posts: 6386
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Upgrade pdf version! Is it possible?

Post by XnTriq »

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

Re: Upgrade pdf version! Is it possible?

Post by cday »

XnTriq wrote:Related: PDF/A
PDF/A places many constraints on a PDF file in order to ensure that archived content can always be read in the future, but is it relevant to this thread?

But when you have time, you should have some useful advice on text enhancement of bitmap images... :D

Edit:

Ah, you've added another link that I nearly posted yesterday, a useful reference but only indirectly relevant to the problem posed as it became better defined.
User avatar
XnTriq
Moderator & Librarian
Posts: 6386
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Upgrade pdf version! Is it possible?

Post by XnTriq »

cday wrote:PDF/A places many constraints on a PDF file in order to ensure that archived content can always be read in the future, but is it relevant to this thread?
Yes, I think so. The OP had requested to “upgrde pdf version to newer” before the thread evolved into a discussion on how to emulate Adobe's or ABBYY's pre-processing procedures in NConvert.
cday wrote:But when you have time, you should have some useful advice on text enhancement of bitmap images...
Feeding lomonosov.png to waifu2x produces fairly interesting results:
p145709.png
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 4172
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Upgrade pdf version! Is it possible?

Post by cday »

Once it becomes clear that a poster is asking the wrong question, as posters often do :wink:, providing detailed resources related to the original question asked seems of limited relevance to me!

I've just had my first look at the original PNG file, and it is indeed remarkable quality for the quite small pixel dimensions: but ultimately it is just a grayscale PNG with ZIP compression, giving a surprisingly small file size as well.

I don't see why the original image can't be reproduced with the same quality in a PDF, which is just a wrapper around an image file, and which should only increase the file size slightly, if the same bit depth and lossless ZIP compression are used??

It seems to me that possibly the file is being downsampled to a lower DPI even in the Adobe PDF, or possibly being changed in some other way?
User avatar
XnTriq
Moderator & Librarian
Posts: 6386
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Upgrade pdf version! Is it possible?

Post by XnTriq »

I believe that both of the following settings have to be activated to achieve similar/identical display of nc_lomonosov.pdf and adobe_lomonosov.pdf:
Acrobat User Guide (Viewing PDFs and viewing preferences → [url=http://helpx.adobe.com/acrobat/using/viewing-pdfs-viewing-preferences.html#main-pars_text_30]Rendering[/url]) wrote:
  • Smooth Line Art: Applies smoothing to remove abrupt angles in lines.
  • Smooth Images: Applies smoothing to minimize abrupt changes in images.
User avatar
XnTriq
Moderator & Librarian
Posts: 6386
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Upgrade pdf version! Is it possible?

Post by XnTriq »

I've extracted the images from nc_lomonosov.pdf and adobe_lomonosov.pdf with PDF-Tools:
nc_lomonosov.png
adobe_lomonosov.png
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 4172
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Upgrade pdf version! Is it possible?

Post by cday »

XnTriq wrote:I believe that both of the following settings have to be activated to achieve similar/identical results for adobe_lomonosov.pdf and nc_lomonosov.pdf:
Acrobat User Guide (Viewing PDFs and viewing preferences → [url=http://helpx.adobe.com/acrobat/using/viewing-pdfs-viewing-preferences.html#main-pars_text_30]Rendering[/url]) wrote:
  • Smooth Line Art: Applies smoothing to remove abrupt angles in lines.
  • Smooth Images: Applies smoothing to minimize abrupt changes in images.
Yes, looking at the PDFs in Adobe Acrobat, I've been thinking that it looks rather like a viewer issue, such as the equivalent of XnView's 'high quality zoom' not being enabled by default...

But, independently of the viewer image quality issue, it should be possible to create a PDF file of the original grayscale image using ZIP compression that isn't much larger than the original 61KB file.

Edit:

I see the original PNG is indexed colour not grayscale...