Print Page | Close Window

Script to Scale Image

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2249
Printed Date: 25 Nov 2017 at 1:55am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Script to Scale Image
Posted By: BabyBandit82
Subject: Script to Scale Image
Date Posted: 03 Nov 2017 at 5:46am
Is there a script to use when placing an image using the button field with this script event.target.buttonImportIcon(); that will scale the image to fit the box proportionally?

Thanks,
BabyBandit



Replies:
Posted By: BAlheit
Date Posted: 03 Nov 2017 at 8:26am
You can specify this in the options of the button.


Posted By: BabyBandit82
Date Posted: 03 Nov 2017 at 8:33am
Where is the face palm emoticon when I need it. Thanks I completely forgot about that silly advanced button for setting that. You are a rockstar.


Posted By: gkaiseril
Date Posted: 03 Nov 2017 at 3:24pm
There are a number of properties for the field object to control the scaling.

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FField_properties.htm%23TOC_buttonFitBoundsbc-5&rhtocid=_6_1_8_31_1_4 - buttonFitBounds
https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FField_properties.htm%23TOC_buttonScaleHowbc-7&rhtocid=_6_1_8_31_1_6 - buttonScaleHow
https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FField_properties.htm%23TOC_buttonScaleWhenbc-8&rhtocid=_6_1_8_31_1_7 - buttonScaleWhen

And then you have the fields rectangle to control the size of the button.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net