Cannot call saveAs javascript code

The PDF-XChange Viewer for End Users
+++ FREE +++

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

jonathanchik
User
Posts: 7
Joined: Thu Sep 04, 2014 9:30 am

Cannot call saveAs javascript code

Post by jonathanchik »

I would like to use javascript to flatten and save a bunch of pdfs. When I try my simple code in the javascript console:

this.flattenPages();
this.saveAs(this.path);

The viewer flatten all pages, but the console gives the following output:
TypeError: this.saveAs is not a function
2: Console:Exec
undefined


I was following the Acrobat javascript reference already.
I have tried those command in the Editor and found no problem. Those two lines of code can run smoothly. Could you give some suggestions? I can only use Viewer in batch process.

Thank you.
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7447
Joined: Wed Mar 25, 2009 10:37 pm

Re: Cannot call saveAs javascript code

Post by Paul - PDF-XChange »

Hi Jonathan,

thanks for the post. That function was not implemented in the Viewer, only the Editor. Is there a reason for using the Viewer here rather than the Editor?

regards
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
jonathanchik
User
Posts: 7
Joined: Thu Sep 04, 2014 9:30 am

Re: Cannot call saveAs javascript code

Post by jonathanchik »

Actually, I intend to implement some automatic batch processing on large number of pdf. However, my company only got the license for Viewer Pro. And I cannot install Editor in my computer due to the Administrative right.
Do you have any suggestion to deal with that? Thank you.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Cannot call saveAs javascript code

Post by Will - Tracker Supp »

Hi Jonathan,

I'm afraid that, other than suggesting using the Editor (which isn't possible for you), there's no further suggestions that we can really make.

Cheers,
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