You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple way to build forms should be present in the creator package. Together with tables etc it should provide a an easy way to make PDF forms using the creator. Advanced support for forms exists in package model although the use is pretty low level and will serve as the basis for this.
Should support:
Input text form (text fields 12.7.4.3 PDF32000_2008).
Checkboxes (12.7.4.2.3)
Radio group selection (12.7.4.2.4)
Buttons (12.7.4.2.4)
Dropdown menu - Choice fields (12.7.4.4)
Basic API ideas:
c:=creator.New()
form:=c.NewForm() // Serves as the AcroForm for the document represented by `c`.tf:=form.NewTextField("field_name1") // occupies available width with some default heighttf.SetDefaultText("Enter your name")
// can force certain width with tf.SetWidth(100)// tf.SetRelHeight(1.2) 1.2 X fontheightc.Draw(tf)
cf:=form.NextCheckboxField("checkbox_male")
cf.SetText("Male")
cf.SetChecked(false)
c.Draw(tf) // Draws at current positioncf=form.NextCheckboxField("checkbox_female")
cf.SetText("Female")
cf.SetChecked(false)
c.Draw(tf) // Draws at current position
The drawing does not involve adding anything to the page contentstream, but rather creating Fields in the AcroForms (that refer the page) and the actual content goes into widget annotations. The annotations should also be added to the page dictionaries Annots array.
For arranging fields it would in many cases make sense to place inside a Table to arrange nicely over the page.
The text was updated successfully, but these errors were encountered:
A simple way to build forms should be present in the creator package. Together with tables etc it should provide a an easy way to make PDF forms using the creator. Advanced support for forms exists in package model although the use is pretty low level and will serve as the basis for this.
Should support:
Basic API ideas:
The drawing does not involve adding anything to the page contentstream, but rather creating Fields in the AcroForms (that refer the page) and the actual content goes into widget annotations. The annotations should also be added to the page dictionaries Annots array.
For arranging fields it would in many cases make sense to place inside a Table to arrange nicely over the page.
The text was updated successfully, but these errors were encountered: