Converting a multi-page PDF to a multi-page PDF

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

Moderators: XnTriq, helmut, xnview

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

Re: Converting a multi-page PDF to a multi-page PDF

Post by cday »

@IxenPDF

I have edited my previous post in respect of the DPI value shown in the file properties.

Will your multi-page files be produced in a Word processor such as Libre Office?

Are you able to make available a representative test file, in respect of colour, resolution and compression?
IxenPDF
Posts: 61
Joined: Tue Aug 02, 2016 8:13 am

Re: Converting a multi-page PDF to a multi-page PDF

Post by IxenPDF »

Thank you.
cday wrote: Thu Apr 01, 2021 9:47 am Will your multi-page files be produced in a Word processor such as Libre Office?
They will be produced by cups. (https://wiki.debian.org/SystemPrinting)
cday wrote: Thu Apr 01, 2021 9:47 am Are you able to make available a representative test file, in respect of colour, resolution and compression?
Not at that time. I am not ready yet.
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting a multi-page PDF to a multi-page PDF

Post by cday »

IxenPDF wrote: Thu Apr 01, 2021 3:06 pm
cday wrote: Thu Apr 01, 2021 9:47 am Will your multi-page files be produced in a Word processor such as Libre Office?
They will be produced by cups. (https://wiki.debian.org/SystemPrinting)
But CUPS is the interface between a software application, such as a word processor or drawing program, and the installed printer, isn't it?

You didn't create 10pages.pdf in it, did you?

cday wrote: Thu Apr 01, 2021 9:47 am Are you able to make available a representative test file, in respect of colour, resolution and compression?
Not at that time. I am not ready yet.
From the code you have posted you will be producing colour documents, or won't that always be the case?

That relates to the optimum compression to use, which you have enquired about, and whether you will need to use lossless compression, which for colour can greatly increase the output file size, except in certain specific cases if you are possibly only using a small number of colours, for example, in illustrations...

You wish to use NConvert to process multipage PDFs, but it isn't too clear what the input files will consist of, or why they will need further processing?

Maybe my mind is too analytical!

Edit:

I have managed to determine that your file 10pages.pdf contains vector text without opening it in a text editor: opened in a PDF viewing software the text is searchable...

Your source file does not therefore consist of image pages, but when processed by NConvert the output file will be consist of image files with a DPI value determined by the -dpi value used in the code which opens them.
IxenPDF
Posts: 61
Joined: Tue Aug 02, 2016 8:13 am

Re: Converting a multi-page PDF to a multi-page PDF

Post by IxenPDF »

cday wrote: Thu Apr 01, 2021 3:35 pm [But CUPS is the interface between a software application, such as a word processor or drawing program, and the installed printer, isn't it?
Yes.
cday wrote: Thu Apr 01, 2021 3:35 pm You didn't create 10pages.pdf in it, did you?
No. This was just a random document to ask my question in post #1.
cday wrote: Thu Apr 01, 2021 3:35 pm From the code you have posted you will be producing colour documents, or won't that always be the case?
No most documents will be b/w (greyscale).
cday wrote: Thu Apr 01, 2021 3:35 pm That relates to the optimum compression to use, which you have enquired about, and whether you will need to use lossless compression, which for colour can greatly increase the output file size, except in certain specific cases if you are possibly only using a small number of colours, for example, in illustrations...
Did I? I was only concerned that the type and strength of compression could be changed by Nconvert, which I want to avoid so that the quality of the document does not suffer. And until now I do not know which type and strength my source document will habe, becuse I am not at this point at the moment.
cday wrote: Thu Apr 01, 2021 3:35 pm You wish to use NConvert to process multipage PDFs, but it isn't too clear what the input files will consist of, ...
It's not clear for ME, because I am not at that point until know.
cday wrote: Thu Apr 01, 2021 3:35 pm You wish to use NConvert to process multipage PDFs, but it isn't too clear why they will need further processing?
This is very clear. I will need to change -brightness and -gamma.

Strange: I had that command (with -gamma and -brightness) produced by XnView MP (export for Nconvert). Now I have made again the same. But now I have gotten another command. Something like

Code: Select all

-hls -79 -87 -0 
instead of

Code: Select all

-brightness 124 -gamma 0.72
I mean not the numbers, but the options. Maybe this is, because I have made an update of XnViewMP?
Maybe "-hls" is what I need, not "-brightness" and "-gamma".
Last edited by IxenPDF on Thu Apr 01, 2021 5:26 pm, edited 1 time in total.
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting a multi-page PDF to a multi-page PDF

Post by cday »

On your last point, regrading hls, gamma and brightnesss, I think you likely inadvertently selected a different batch convert action...

More generally, with so many parameters concerning what you will in the future wish to use as input to NConvert remaining open, it is difficult to know what useful advice can be given.

You did, early on in what is now a very long thread, refer to wanting to be able to process source PDFs with different characteristics while maintaining their original quality: given that an NConvert code line can only process input files using specified colour and compression options, I think you could only do that by creating a script if you are able to use bash, for example, to read the -info parameters of the particular source file into variables, and then use bash code to configure the NConvert code line to be run to suit those parameters.
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting a multi-page PDF to a multi-page PDF

Post by cday »

If you need to process alternative types of source file and writing a general purpose script seems daunting, if you could use alternative NConvert files configured for alternative types of input (colour, black and white, etc.) that should be very much easier, and you probably wouldn't need many, maybe only two or three, I would think... :D

Writing a general purpose script to process alternative types of input would certainly require some detailed knowledge of bash or another scripting utility.
IxenPDF
Posts: 61
Joined: Tue Aug 02, 2016 8:13 am

Re: Converting a multi-page PDF to a multi-page PDF

Post by IxenPDF »

Thank you.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Converting a multi-page PDF to a multi-page PDF

Post by XnTriq »

IxenPDF wrote: Thu Apr 01, 2021 7:35 amSo how can I find out the real properties of my pictures that are in my pdf? Is there any third party tool, that can do this?
Command-line tool: Poppler for Windows
XnTriq wrote: Tue Feb 21, 2017 6:00 pm
pdfimages.exe -list 'Das_erfolgreiche_Bewerbungsgespräch-72 s-w extr 11.pdf' wrote:

Code: Select all

page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image     550   851  gray    1   1  ccitt  no         3  0    72    72 12.9K  23%
pdfimages.exe -list lösch.pdf wrote:

Code: Select all

page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image    2835  2209  gray    1   1  ccitt  no         9  0   300   300 71.9K 9.4%
GUI: PDF-XChange Editor

PDF-XChange Editor v8
PDF-XChange Editor v8
PDF-XChange Editor v9
PDF-XChange Editor v9
Post Reply