Itext 7 - Cannot get tab order of the field - itext

Is it possible to get the tab order of the PDF field with iText7?
You can define tab order in Acrobat but getting that tab order doesn't seem to be available in the iText7 library.
I'm writing an application that extracts the fields from the PDF file and wanted those fields to be sorted depending on the tab order defined from the PDF.

The order of fields (or more to the point: of annotations) on a page is determined by the Tabs entry in the page dictionary. Its value is specified as:
(Optional; PDF 1.5) A name specifying the tab order that shall be used for annotations on the page (see 12.5 "Annotations"). The possible values shall be R (row order), C (column order), and S (structure order). Beginning with PDF 2.0, the possible values also include A (annotations array order) and W (widget order). Annotations array order refers to the order of the annotation enumerated in the Annots entry of the Page dictionary (see "Table 31 — Entries in a page object"). Widget order means using the same array ordering but making two passes, the first only picking the widget annotations and the second picking all other annotations.
(ISO 32000-2, Table 31 — Entries in a page object)
To implement your task of extracting fields to be sorted depending on the tab order defined from the PDF, therefore, you have to read this value for the page in question and depending on it, analyze the annotation coordinates, the structure tree, or the annotation array accordingly.
By the way, for fields with multiple widgets this means that they also have multiple tab positions; thus, exporting the fields to be sorted depending on the tab order defined from the PDF may be impossible for some documents.

Related

Where are form elements rendered in Drupal 7? I'm looking for why the sixth item in a select option list doesn't get rendered

I have Drupal 7.58 site where there's a select list with 15 items that come from an entity reference. When I put a debugging statement into form_type_select_value in includes/form.inc, the whole array of items is there, so I know the query is working, and the form element should be built correctly.
But when the select list is display, the sixth element goes missing. I've found a short term way to circumvent this, by adding a dummy sixth item, but that's not going to fly in the long term.
What I need to know is where does it go after form_type_select_value?
edit: More info
This is happening in an Entityform where the field type is Entity Reference and the Widget is Select List. In Manage Fields under Entity Selection, I select an entity called Store, in Simple mode. There are 15 Stores, and these are sorted by the Title property, sorted in the Ascending direction.
When I sort in Descending direction, a different item is missing, but it's always the 6th from the top.
I've debugged it up to the point where the data comes in, before it's rendered, and it's all there in the outgoing array.

Is it possible to modify parts of the form based on one of the field of the form?

I am using the Formula package from the Iliad web framework in Pharo. I have a model object which have a first attribute and then one to three other attributes depending of the value of the first one.
I built a form with ILFormula but couldn't find methods in Formula to change the displayed input based on changed value on the first field.
So I believe I need to add an event on the first field and do it directly but I am not sure where to begin to that within the Iliad framework.

Popup window for complex structured data in an extjs form field

I need to build the following form field. Let's take the case where in a form I have multiple fields. Two of them are "last name" and "first name". Instead of the classic way when these field will show seperatley I want a single fields thatt shows when completed like a text field with value a concatenqtion of e two values ( ie "michael jackson"). When I click on the field an window (like a picker date) will popup haing a form with the two fields.
Unfortunately i do not know where to start from:
what class should I derive
how should I store the value in the form ( two hidden values or just a serialized value of the fields).
I might have complex structure with 5-6 fields in this picker popup.
I would extend Ext.form.field.Picker. In the createPicker() method you can crate whatever combination of fields an components that you want.
Re: storage of data, I'd serialze the values in the one field. Then you can treat reads and commits in the same way (and you can always manipulate the data later.
Here's an example that I did a while back: jsfiddle.net/existdissolve/wMcQk/

knockout - update UI (filter data) based on select/dropdown choice?

How can I update this UI based on the selection made in the select/dropdowns?
For example, if I select a member name from the select/dropdown, I want the table to update/filter to only show those member rows (member names are in far right column) AND their corresponding date header (the gray background).
If I select a provider name from the select/dropdown), I want the table to update/filter to only show those provider rows (provider names in left column) AND their corresponding date header (the gray background).
I'm using the KO mapping plugin. The dummy data is hard coded and would eventually be returned via ajax.
Here's a fiddle of all the code (it's all just inlined in the HTML pane). You could copy/paste this and run it locally if you wanted, as well.
http://jsfiddle.net/qBGTh/
Any help/direction is greatly appreciated!
My suggestion is to use a computed value at eob level returning the filtered array. To add this computed value during the mapping process, you must customize the eob object creation using a create callback in the mapping options parameter (see mapping doc)
Here is the updated fiddle to see it in action.
Also don't forget to add 2 more observables to capture current values for the 2 select elements. The computed value will depend on those 2 observables.
Note: the provided fiddle will not run on IE as github where is located the
mapping javascript does not return the content-type header required by IE.

Create a new FileMaker layout showing unique records based on one field and a count for each

I have a table like this:
Application,Program,UsedObject
It can have data like this:
A,P1,ZZ
A,P1,BB
A,P2,CC
B,F1,KK
I'd like to create a layout to show:
Application,# of Programs
A,2
B,1
The point is to count the distinct programs.
For the life of me I can't make this work in FileMaker. I've created a summary field to count programs resetting after each group, but because it doesn't eliminate the duplicate programs I get:
A,3
B,1
Any help much appreciated.
Create a a summary field as:
cntApplicaiton = Count of Application
Do this by going into define fields, create a field called cntApplication, type summary. In the options dialogue make the summary field a count on application
Now create a new layout with a subsummary part and nobody. The subsummary should be sorted on Application. Put the Application and cntApplication fields in subsummary. If you enter browse mode and sort by Application you ought to get the data you want.
You can also create a calc field with the formula
GetSummary(cntApplication; Application)
This will allow you to use the total number of Applications with in a record
Since I also generate the data in this form, the solution I've adopted is to fill two tables in FileMaker. One provides the summary view, the other the detailed view.
I think that your problem is down to dupliate records and an inadequate key.
Create a text field called "App_Prog". In the options box set it to an auto-enter calc, unchecking the 'Do not replace...' option, and use the following calc:
Application & "_" & Program
Now create a self join to the table using App_Prog as the field on both sides, and call this 'MatchingApps'.
Now, create (if you don't alread have one) a unique serial number field, 'Counter' say, and make sure that you enter a value in each record. (Find all, click in the field, and use serial number option in'Replace Field Contents...')
Now add a new calc field - Is_Duplicate with the following calc...
If (Counter = MatchingApps::Counter; "Master Record" ; "Duplicate")
Finally, find all, click in the 'Application field, and use 'Replace Field Contents...' with a calculation to force the auto-enter calc for 'App_Prog' to come up with a value.
Where does this get you? You should now have a set of records that are marker either "Master Record" or "Duplicate". Do a find on "Master Record", and then you can perform your summary (by Application) to do a count of distinct application-program pairs.
If you have access to custom functions (you need FileMaker Pro Advanced), I'd do it like this:
Add the RemoveDuplicates function as found here (this is a recursive function that takes a list of strings and returns a list of unique values).
In the relationships graph, add another occurrence of your table and add an Application = Application relationship.
Create a calculated field in the table with the calculation looking something like this:
ValueCount(RemoveDuplicates(List(TABLE2::Program)))
You'll find that each record will contain the number of distinct programs for the given application. Showing a summary for each application should be relatively trivial from here.
I think the best way to do this is to create a separate applications table. So as you've given the data, it would have two records, one for A and one for B.
So, with the addition of an Applications table and your existing table, which I'll call Objects, create a relationship from Applications to Objects (with a table occurrence called ObjectsParent) based on the ApplicationName as the match field. Create a self join relationship between Objects and itself with both Application and Program as the match fields. I'll call one of the "table occurrences" ObjectsParent and the other ObjectsChildren. Make sure that there's a primary key field in Objects that is set to auto-enter a serial number or some other method to ensure uniqueness. I'll call this ID.
So your relationship graph has three table occurrences:
Applications::Applicaiton = ObjectsParent::Application
ObjectsParent::Application = ObjectsChildren::Application, ObjectsParent::Program = ObjectsChildren::Program
Now create a calculation field in Objects, and calculating from the context of ObjectsParent, give it the following formula:
AppCount = Count( ObjectsChildren::ID )
Create a calculation field in Applications and calculating from the context of the table occurrence you used to relate it to ObjectsParent with the following formula:
AppCount = ObjectsParent::AppCount
The count field in Objects will have the same value for every object with the same application, so it doesn't matter which one you get this data from.
If you now view the data in Applications in list view, you can place the Applications::Application and Applications::AppCount fields on the layout and you should get what you've requested.