Skip to main content
Alex Doubts
Known Participant
Jul 18, 2017 5:25 AM UTC
Question

How to convert image to binary file/stream in adobe acrobat pro?

I want to convert image to binary file/stream in adobe acrobat pro using Adobe Javacipt.  I need to embed the  uploaded image path as a binary file/stream and then add to 2D Bar code and fetch the image while reading from the bar code.

This topic is closed to new replies. Start a new post to keep the conversation going.

11 replies

Joel Geraci
Community Expert
Community Expert
Jul 18, 2017 5:03 PM UTC

Trying to clarify... you want to import an image, convert it to a base64 string and then set the value of a barcode field so that when the barcode is later scanned, you can interpret the barcode data as an image.

Did I get that right?

Translate
Alex Doubts
Known Participant
Jul 19, 2017 4:46 AM UTC

Yes this is exactly what I want. i am using Adobe Acrobat pro. I can browse the image and upload the same fine. But unable to convert the image field to base 64 string.

Tried few  solutions but none has  worked.

Translate
Known Participant
Sep 10, 2020 3:42 PM UTC

Did you resolve this issue ? I'm doing same thing Could you please help me

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 18, 2017 10:05 AM UTC

This is not possible.

Translate
Alex Doubts
Known Participant
Jul 18, 2017 11:11 AM UTC

Any solution to do the same. I tried various ways to covert the Image Field to base64 string in barcode so as to fetch the image from the barcode while reading the data from it. I am using Adobe Acrobat Pro.

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 18, 2017 12:51 PM UTC

Can you explain what you want?

Translate
Alex Doubts
Known Participant
Jul 18, 2017 5:45 AM UTC

Tried to convert the uploaded image to binary stream under button click so as to embed to bar code and to fetch the image while reading.But the stream data is coming as alert.

// JScript source code

var pathFile = "E:/Adobe/PDF/Images/home.jpg";

app.alert(pathFile);

this.importIcon("myIcon", pathFile, 0);

var oIcon = util.iconStreamFromIcon(this.getIcon("myIcon"));

app.addToolButton({

    cName: "btnTest",

    oIcon: oIcon,

    cExec: "console.println('My Button!');",

    cTooltext: "Test!",

    nPos: 0

});

app.alert("b");

app.alert(oIcon);

Translate
Alex Doubts
Known Participant
Jul 18, 2017 6:01 AM UTC

var pathFile = "E:/Adobe/Alex/Smart PDF latest/Images/home.jpg";

var inputStream = event.target.getDataObjectContents(pathFile);

app.alert(inputStream);

var k = util.stringFromStream(inputStream);

app.alert(k);

Not working in above method too

Translate