PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

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

 
bernard meunier
User
Topic Author
Posts: 32
Joined: Tue May 06, 2014 7:52 pm

How to delete pages 2 pages before last page?

Thu Mar 23, 2017 7:37 pm

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: 1150
Joined: Wed Jan 18, 2006 12:10 pm

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

Thu Mar 23, 2017 8:39 pm

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: 1548
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

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

Thu Mar 23, 2017 9:54 pm

Hello,

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

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
Topic Author
Posts: 32
Joined: Tue May 06, 2014 7:52 pm

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

Fri Mar 24, 2017 6:05 pm

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: 1548
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

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

Fri Mar 24, 2017 8:07 pm

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
Topic Author
Posts: 32
Joined: Tue May 06, 2014 7:52 pm

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

Fri Mar 24, 2017 8:29 pm

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: 5881
Joined: Mon Oct 15, 2012 9:21 pm
Location: Chemainus, BC
Contact:

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

Sat Mar 25, 2017 8:56 pm

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
http://www.tracker-software.com

Who is online

Users browsing this forum: No registered users and 1 guest