Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
ArtIn_Act@adobeforums.com #1
"Page" and "Rect" props of the Field prop in Javascript API
Page property of the Field property in Javascript Acrobat API returns an array of pages that this field exists in. On the other hand, "rect" property returns just one set of coordinates of the field on a page.
My questions are:
1. Suppose field's "page" property returns two pages, 2 and 3, for a document in question. How I can use "rect" property of a field to determine position of the field on these pages?
2. If "rect" property of a field is not the one to be used to determine position of a field on a page - then what property should I use?
ArtIn_Act@adobeforums.com Guest
-
Proj cannot run on LCDS 2.6 ES due to "Unable to resolveresource bundle "datamanagement" for locale "en_US"
hi, all, We have developped an application on Flex Build 3 (run successfully), but failed when we try to deploy it on Tomcat with LCDS 2.5 ES... -
CFINPUT type="radio" w/ "value" requires "label"
On a Flash form, when you specify type='radio' and value='whatever', the value of the 'value' attribute will be displayed as a label if no 'label'... -
Compare 2 fields & delete everything in "field 2" that occurs in "field 1"
Is it possible to compare 2 fields and delete everything in "field 2" that also occurs in "field 1" ? FIELD1 800-555-1212 for... -
dr("field").toString returns "400.0000" instead of "400"
I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to... -
"Start" "Program" "Menu" list is empty
For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your... -
Bernd Alheit #2
Re: "Page" and "Rect" props of the Field prop in Javascript API
When you have fields with the same name like "Text" you can access the different fields:
this.getField("Text.0")
this.getField("Text.1")
....
Look at the documentation of the field object.
Bernd Alheit Guest
-
ArtIn_Act@adobeforums.com #3
Re: "Page" and "Rect" props of the Field prop in Javascript API
Bernd,
Thank you for the quick reply. I read the "field" documentation, but did not find any reference to page number being used in the construction of field name hierarchy. Following is my explanation of how I understood your example:
Suppose the field in question has name "Text". Its "page" property returns an array of three pages - 4, 6 and 8. Then, in order to get coordinates of this field "Text" on these separate pages, I have to construct the fully qualified name as "Text.0" (corresponds to page #4 in my example), "Text.1" (page 6) and "Text.2" (page 8) ? Or it should be directly "Text.4", "Text.6", "Text.8"?
I appreciate your help in this issue.
ArtIn_Act@adobeforums.com Guest
-
Bernd Alheit #4
Re: "Page" and "Rect" props of the Field prop in Javascript API
The fields are identified by an index (0-based), not page number. The index is determined by the order in which the individual widgets of this field were created. In your example the field "Text.0" can be on page 4, 6, or 8.
Bernd Alheit Guest
-
ArtIn_Act@adobeforums.com #5
Re: "Page" and "Rect" props of the Field prop in Javascript API
Ok. I am getting more and more lost :). My understanding is that "widget" may be a part of the "field" and in the simplest case widget IS the field. Let "Text" in your example be a simple field (no widgets as part of the field). Using your example: field "Text" is on page 4, 6 or 8.(call to getField("Text").page returns array 4,6,8). What is the api call to coordinates of "Text" field on page 6?
ArtIn_Act@adobeforums.com Guest
-
PDL@adobeforums.com #6
Re: "Page" and "Rect" props of the Field prop in Javascript API
Because there is no way to directly relate the array position of the field with what page it is on, you would need to iterate through the multiple "Text" fields, using the method Bernd showed, and find the one that has the page property you are looking for.
var myRect = null;
for ( var i = 0; i < 3; i++ ) { if ( this.getField("Text." + i).page == myPage ) { myRect = this.getField("Text." + i).rect; break; } }
PDL@adobeforums.com Guest
-
ArtIn_Act@adobeforums.com #7
Re: "Page" and "Rect" props of the Field prop in Javascript API
Aha! Thank you, guys! So, to summarize, at least in the case of "simple" field, the notation FieldName.PageIndex creates a fully qualified name for a field located on a specific page. Page index is an 0-base index to an array of pages that is returned for a generic FieldName.
Example:
Call getField("Test").page returns (4, 6, 8 ). It means that there are three fields in the document that start with "Test": "Test.0", "Test.1" and "Test.2" and these fields are located on pages 4, 6 or 8 but not necessarily in order.
Calls to getField("Test.0").page, or getField("Test.1").page or getField("Test.2").page
should _always_ return one page where this field is located and not an array of pages.
Correct?
ArtIn_Act@adobeforums.com Guest
-
Bernd Alheit #8
Re: "Page" and "Rect" props of the Field prop in Javascript API
Correct?
Yes
Bernd Alheit Guest
-
ArtIn_Act@adobeforums.com #9
Re: "Page" and "Rect" props of the Field prop in Javascript API
Bernd - thank you for your help!
ArtIn_Act@adobeforums.com Guest



Reply With Quote

