How to delete pages 2 pages before last page?

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

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

Post Reply
bernard meunier
User
Posts: 120
Joined: Tue May 06, 2014 7:52 pm

How to delete pages 2 pages before last page?

Post by bernard meunier »

Hi,
I'm asking myself either or not it is possible to create a script so that to silently
remove 2 pages before the last page of a lot of documents at time?
(I do drop the "delete pages" action but you have to specify the range
from start! I guess entering 2-3 will delete second and third pages from
start... I'm looking for the same but from last)
Regards,
Bernie
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: How to delete pages 2 pages before last page?

Post by Willy Van Nuffel »

Nothing more but an idea... Doing the job in three steps:

1) Split/Merge all pages in reverse order

2) Delete pages 2-3

3) Split/Merge all pages in reverse order
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: How to delete pages 2 pages before last page?

Post by Patrick-Tracker Supp »

Hello,

Thank you for your post. This should be fairly easy to do using a JavaScript such as below:

Code: Select all

this.deletePages({nStart: this.numPages - 3, nEnd: this.numPages - 2});
You can activate the JavaScript console by using [Ctrl]+[J].
I hope this helps!
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America
bernard meunier
User
Posts: 120
Joined: Tue May 06, 2014 7:52 pm

Re: How to delete pages 2 pages before last page?

Post by bernard meunier »

Hi,

I will try Willy's idea which should allow doing a "black Box" PDF tools icon on the desktop. (Thanks Willy).
I will keep Patrick's answer ... which will be useful to create a script which can be attached to
an icon in PDF Editor. (Thanks Patrick).

Regards
Bernie
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: How to delete pages 2 pages before last page?

Post by Patrick-Tracker Supp »

Anytime :)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America
bernard meunier
User
Posts: 120
Joined: Tue May 06, 2014 7:52 pm

Re: How to delete pages 2 pages before last page?

Post by bernard meunier »

Here is result:

function DeletePageBeforeLast()
{
this.deletePages(this.numPages - 3, this.numPages - 2);
}

app.addToolButton({
cName: "Delete Page Before Last",
cExec: "DeletePageBeforeLast()",
cTooltext: "Delete 2pages before end of doc",
cEnable: true,
nPos: 0
});

Following Willy's instructions (Thanks)
I did create the javascripts manually in PDF Edition installation folder
C:\Apl\Tracker Software\PDF Editor\Javascripts
And dropped the file.js in it to get desired button.

BTW the PDF tools script as well works... but javascript perform faster!

Regards
Bernie
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: How to delete pages 2 pages before last page?

Post by Will - Tracker Supp »

Thanks Bernard, much appreciated! :)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply