Is there a JavaScript API to save binary data to the hard drive

New Here ,
Aug 02, 2017

Copy link to clipboard

Copied

Hi,

I happened to have to work in a very old environment with Adobe Acrobat 7.1 installed, but I think even newer version does not have an API for this.

Say I have some random data var data = 0xe3f2b1 and I want to save this data alone to the hard drive. Would there be a way to do this?

I tried to convert to string, create data object and then export data object, like

var str = String.fromCharCode(0xe3, 0xf2, 0xb1);

this.createDataObject("MyData.dat", str);

this.exportDataObject("MyData.dat");

This ended up not saving any byte greater than 0x80 (not saving anything in extended ASCII range). If I have a byte 0xb0, it would be saved as 0x80.

Just wondering is there any way to export random data out of the Acrobat? Even if emailing the data file out as an email attachment would be fine.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

160

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

Is there a JavaScript API to save binary data to the hard drive

New Here ,
Aug 02, 2017

Copy link to clipboard

Copied

Hi,

I happened to have to work in a very old environment with Adobe Acrobat 7.1 installed, but I think even newer version does not have an API for this.

Say I have some random data var data = 0xe3f2b1 and I want to save this data alone to the hard drive. Would there be a way to do this?

I tried to convert to string, create data object and then export data object, like

var str = String.fromCharCode(0xe3, 0xf2, 0xb1);

this.createDataObject("MyData.dat", str);

this.exportDataObject("MyData.dat");

This ended up not saving any byte greater than 0x80 (not saving anything in extended ASCII range). If I have a byte 0xb0, it would be saved as 0x80.

Just wondering is there any way to export random data out of the Acrobat? Even if emailing the data file out as an email attachment would be fine.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

161

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
Aug 02, 2017 0
New Here ,
Aug 04, 2017

Copy link to clipboard

Copied

Anyone knows this?

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...
Aug 04, 2017 0
Adobe Community Professional ,
Aug 04, 2017

Copy link to clipboard

Copied

This works just fine from the console. How are you trying to execute it? ExportDataObject has security restrictions so you may not be able to run it from where it's being triggered.

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...
Aug 04, 2017 0