Revert file

New Here ,
Dec 07, 2017

Copy link to clipboard

Copied

Hello,

I'm wondering how to revert a pdf file to last saved version via javascript.

Any suggestions would be much appreciated.

Thanks in advance, M.

TOPICS
Acrobat SDK and JavaScript

Views

177

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Revert file

New Here ,
Dec 07, 2017

Copy link to clipboard

Copied

Hello,

I'm wondering how to revert a pdf file to last saved version via javascript.

Any suggestions would be much appreciated.

Thanks in advance, M.

TOPICS
Acrobat SDK and JavaScript

Views

178

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 07, 2017 0
Adobe Community Professional ,
Dec 07, 2017

Copy link to clipboard

Copied

Close without save and re-open the document.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 07, 2017 1
Adobe Community Professional ,
Dec 07, 2017

Copy link to clipboard

Copied

Ha ha Good one!

I always thought it would be a cool to write backup tool for the internal PDF saves. Never had time though. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 07, 2017 0
Most Valuable Participant ,
Dec 08, 2017

Copy link to clipboard

Copied

var filePath = this.path;

this.closeDoc(true);

app.openDoc(filePath);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 08, 2017 1
Most Valuable Participant ,
Dec 08, 2017

Copy link to clipboard

Copied

Will the script continue to execute after the document is closed?

I'm pretty sure the actual implementation of revert is much like this except

- note page number, page view, window size and position, and current viewing options

- close without saving

- reopen

- restore page number, page view, window size and position, and current viewing options

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 08, 2017 1
try67 LATEST
Most Valuable Participant ,
Dec 08, 2017

Copy link to clipboard

Copied

Should be, yes.

Restoring the view state is possible, but only if the file is disclosed. Otherwise the openDoc command will not return a reference to it so it won't be possible to manipulate it after re-opening it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 08, 2017 1