Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Home
- Acrobat SDK
- Discussions
- can these formulas (excel) be converted to calcula...

- can these formulas (excel) be converted to calcula...

can these formulas (excel) be converted to calculate on a pdf form

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/td-p/10045080
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

these are the formulas

3 separate cells

=ROUND((10^7.96427)*10^((-1628.445/(T24+273.15)))*10^((-100151/(T24+273.15)^2)),2)

=ROUND((10^7.96427)*10^((-1628.445/(T25+273.15)))*10^((-100151/(T25+273.15)^2)),2)

=(Y27-(0.00066*760*(T24-T25)*(1+(0.00115*T25))))/Y26

Thanks in advance

TOPICS

Acrobat SDK and JavaScript
,
Windows

Community guidelines

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

7
Replies
7

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045081#M20158
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

Community guidelines

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

markg90430338
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045082#M20159
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

i unfortunately have no experience writing javascript.

i tired a in the example below but could not get the proper calculation

event.value=Math.exp((10^7.96427)*10^((-1628.445/(WBC+273.15)))*10^((-100151/(WBC+273.15)^2)),2)

event.value=Math.exp((10^7.96427)*10^((-1628.445/(DBC+273.15)))*10^((-100151/(DBC+273.15)^2)),2)

Y27-(0.00066*760*(T24-T25)*(1+(0.00115*T25))))/Y26

Where have i gone wrong?

Community guidelines

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

markg90430338
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045083#M20160
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

ultimately i would like to calculate relative humidity from dry bulb and wet bulb temperature. there are a couple different ways to calculate, however can not get any proper calculation as i am javascript illiterate. attached original formulas and an excel sheet that does what i need (formulas imbedded)

https://www.sksato.co.jp/html_e/files/Psychrometer1.1E.xls

any help would be muchly appreciated.

Community guidelines

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045084#M20161
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

First of all, check the JS Console and you'll see some error messages. The first one will be probably be something like this:

ReferenceError: WBC is not defined

1:Console:Exec

That happens because there's no variable called WBC. You can't access the value of a field directly. You need to use the getField method, and then the value property, like this:

var WBC = this.getField("WBC").value;

And if you want to make sure it's a number, use this:

var WBC = Number(this.getField("WBC").value);

Make those changes and try again. Check if there still error messages in the Console, and repeat...

Community guidelines

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045085#M20162
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

Did you read the linked description for the Math.exp?

You might want to use the Math.pow() method.

Syntax

Math.pow(base, exponent)

Parameters

base

The base number.

exponent

The exponent used to raise the base.

Return value

A number representing the given base taken to the power of the given exponent.

Community guidelines

markg90430338
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045086#M20163
Jul 21, 2018
Jul 21, 2018

Copy link to clipboard

Copied

thank you for this but it looks like its way over my head, anyone care to take a crack at it?

i will try my best to post existing formulas from excel with explainations

will be calculated from 3 separate text fields

text field - es

=ROUND((10^7.96427)*10^((-1628.445/(dbr+273.15)))*10^((-100151/(dbr+273.15)^2)),2)

text field - ew

=ROUND((10^7.96427)*10^((-1628.445/(wbr+273.15)))*10^((-100151/(wbr+273.15)^2)),2)

text field - e

=(es-(0.00066*760*(dbr-wbr)*(1+(0.00115*wbr))))/ew

text fields dbr and wbr could have any number between 0 to 130

any help would be great!

thanks in advance

Community guidelines

LEGEND
,

LATEST
/t5/acrobat-sdk-discussions/can-these-formulas-excel-be-converted-to-calculate-on-a-pdf-form/m-p/10045087#M20164
Jul 22, 2018
Jul 22, 2018

Copy link to clipboard

Copied

You are clearly not writing JavaScript. JavaScript is an object orientated language. That means you have an object and that object can have various properties beyond the value. So you cannot write code as one does within a cell in Excel. I have looked at your locked worksheet and the formulas that you have posted. It is clear the data used in your formulas is coming from cells that I cannot view.

There free and pay for resources for learning JavaScript for Acrobat.

Community guidelines

Copyright © 2022 Adobe. All rights reserved.