Highlighted

How we can restrict to user not to upload images more than 45 kb on PDF using Javascript on adobe

Community Beginner ,
Sep 03, 2020

Copy link to clipboard

Copied

Hello All,

 

I have to write a Java scrript to User not to upload Images for More than 45 kb. I have checked the Bible did not find anything related to images size Validation , Could you please help me with this.

TOPICS
Acrobat SDK and JavaScript, Cancel subscription, Comment review and collaborate PDF, Crash or freeze, Create PDFs, Edit and convert PDFs, Install update and subscribe to Acrobat, PDF forms, Scan documents and OCR, Security digital signatures and esignatures, Standards and accessibility

Views

60

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

How we can restrict to user not to upload images more than 45 kb on PDF using Javascript on adobe

Community Beginner ,
Sep 03, 2020

Copy link to clipboard

Copied

Hello All,

 

I have to write a Java scrript to User not to upload Images for More than 45 kb. I have checked the Bible did not find anything related to images size Validation , Could you please help me with this.

TOPICS
Acrobat SDK and JavaScript, Cancel subscription, Comment review and collaborate PDF, Crash or freeze, Create PDFs, Edit and convert PDFs, Install update and subscribe to Acrobat, PDF forms, Scan documents and OCR, Security digital signatures and esignatures, Standards and accessibility

Views

61

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
Sep 03, 2020 0
Adobe Community Professional ,
Sep 03, 2020

Copy link to clipboard

Copied

You can check the size of the icon stream.

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...
Sep 03, 2020 0
Community Beginner ,
Sep 03, 2020

Copy link to clipboard

Copied

I have used this method but it's giving same value for diffrent images 

var im1 = this.getField(event.target.name);
// get the icon for image 1
var icon1 = im1.buttonGetIcon();
try {
var iconStream1 = util.iconStreamFromIcon(icon1);
var dd= icon1.toSource().length

Is this not correct?

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...
Sep 03, 2020 0
Adobe Community Professional ,
Sep 03, 2020

Copy link to clipboard

Copied

Check the size of iconStream1

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...
Sep 03, 2020 0
Community Beginner ,
Sep 03, 2020

Copy link to clipboard

Copied

I did, it's showing "undefined "

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...
Sep 03, 2020 0
Adobe Community Professional ,
Sep 03, 2020

Copy link to clipboard

Copied

How does you check the size?

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...
Sep 03, 2020 0
Most Valuable Participant ,
Sep 03, 2020

Copy link to clipboard

Copied

You can't do it while they're selecting the image to prevent them from doing so. Maybe you can use an On Blur event on the button or the document's Will Save event to check the length of the icon stream, as mentioned, or even the file-size...

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...
Sep 03, 2020 0