Incorrect page order when creating a multipage file

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

Post Reply
Pragasam
Posts: 5
Joined: Wed Feb 06, 2019 1:43 pm

Incorrect page order when creating a multipage file

Post by Pragasam »

Hi Team

I am trying to convert collection of PNG's to single PDF with Nconvert from dotnet. PDF created with out any issue but the pdf page order is not matched with PNG file names.

Please find the multiple file names which I have tried below

Example : 1

PNG file names : 1,2,3,4,5.... etc

Example: 2

PNG file names : 1001,1002,1003,1004... etc


I could see that the page order is not matched with PNG file name.

Note : The png is created from Tiff files with the help of same Nconvert so crated date time is same for all the files. All the file are looking good. But only the PDF pages order is not matched.

Let me know that, What is the file name that i have to follow to get it done with the page order in the PDF.


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

Re: PNG to PDF page order issue

Post by cday »

Pragasam wrote: Tue Feb 16, 2021 2:51 pm Hi Team
It's one developer of all xnview software, and a very small number of volunteers who regularly provide some support... :D

I am trying to convert collection of PNG's to single PDF with Nconvert from dotnet. PDF created with out any issue but the pdf page order is not matched with PNG file names.

You are using the command line utility NConvert, but you have posted in the XnView Classic forum section? :wink:

To be clear, you wish to create a multi-page PDF from single page image files?

The problem you are encountering is I believe a rather subtle one that has caused people, myself included, trouble before.

The issue is that command line software reads input files in a different sort order than Windows, for example.

The following recent post is one of several in the forum that explain the problem in more detail, and the short answer is to renumber the input files with leading zeros in Windows before running the code, or alternatively to add an offset in a batch file so that numbering 1,2,3... becomes say 1001, 1002, 1003... before creating the multi-page file:

Sort order
Post Reply