Missing Topic: Merging alternate pages  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
arpy
User
Posts: 8
Joined: Fri Feb 26, 2021 12:20 am

Missing Topic: Merging alternate pages

Post by arpy »

Hi,

maybe 2 years ago, I saved a bookmark: viewtopic.php?p=91984#p91984

It contains a small JS to merge 2 PDFs, first one with only the front pages, second one with the back pages in reverse order (so you are able to create a proper PDF even if you only have a single page scanner).

Unfortunately, now the link is no longer valid - is there meanwhile a better way to accomplish this, or can anybody please provide the script again?

kind regards
arpy
lev
User
Posts: 258
Joined: Fri Apr 11, 2014 1:18 am

Re: Missing Topic: Merging alternate pages

Post by lev »

There's a script that does what you are asking for in
viewtopic.php?p=159933&hilit=interweave#p159933

The script takes a single PDF that contains all odd pages (1, 3, 5,...) followed by all even pages (2, 4, 6,...) and reorders them so that page 1 is followed by page 2, etc. Before you run the script you have to merge the 2 PDFs.

If you do not need to have a button for such an operation you can run just the script part in the JavaScript window:

Code: Select all

{
   //Reorder Pages A1, B1, A2, B2, A3, B3...

	for (i = 0; i < ((this.numPages - 1)/2); i++) 
	{
		this.movePage(Math.ceil(this.numPages/2)+i,2*i);
	}
}
User avatar
rakunavi
User
Posts: 870
Joined: Sat Sep 11, 2021 5:04 am

Re: Missing Topic: Merging alternate pages

Post by rakunavi »

Hi arpy,

As you may already know, for merging under complex conditions, PDFsam Basic is also recommended. It has features that complement the PDF-XChange Editor.

  • https://pdfsam.org/pdfsam-basic/
Check the Reverse option on the back pages and run the &quot;Alternate Mix&quot;
Check the Reverse option on the back pages and run the "Alternate Mix"

I hope that someday a similar feature will be implemented in the PDF-XChange Editor.

Best regards,
rakunavi
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
arpy
User
Posts: 8
Joined: Fri Feb 26, 2021 12:20 am

Re: Missing Topic: Merging alternate pages

Post by arpy »

Hi,

@lev: I found this script before, but it doesn't change the order of the back sides of the scanned papers.
@rakunavi: Thanks, yes, I know this, but honestly, I don't want to use additional software in this workflow.

As I mentioned, there was a working solution, but the code is no longer available in this forum for whatever reason. And unfortunately I only saved the link but not the content (and archive.org is also not helping....)

Thanks so far. Let's see, maybe a Mod can recover the content or a user has saved a copy of the script.

kind regards
arpy
User avatar
rakunavi
User
Posts: 870
Joined: Sat Sep 11, 2021 5:04 am

Re: Missing Topic: Merging alternate pages  SOLVED

Post by rakunavi »

Hi arpy,

If you would like to merge the back pages in reverse order, try the script below.

Code: Select all

for (i = 0; i < ((this.numPages - 1)/2); i++) 
	this.movePage(this.numPages-1,2*i);
The following is the result of sorting a file with a total of 36 pages (Front:18 pages, Back:18 pages). Note that the back pages are in reverse order. The left side of the screen is before sorting, and the right side is after sorting.

Reordering.png

Best regards,
rakunavi
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
arpy
User
Posts: 8
Joined: Fri Feb 26, 2021 12:20 am

Re: Missing Topic: Merging alternate pages

Post by arpy »

Hi rakunavi,

thanks a lot, that's exactly what I was looking for!

kind regards
arpy
User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 1778
Joined: Mon Jan 15, 2018 9:01 am

Missing Topic: Merging alternate pages

Post by Dimitar - Tracker Supp »

:)
Post Reply