This code snippet is taken from TaggedPDF.cs line 87 in the
AccessiblePDF example project.
List<Element> items = new List<Element>();
FindAll(item, items);
return items;
Dim items As New List(Of Element)()
FindAll(item, items)
Return items
This code snippet is taken from Annotations.cs line 464 in the
Annotations example project.
if (inKids.Count == 0)
throw new Exception("Cannot have a group field with no kids");
int fieldID = Doc.AddObject("<< /Kids [] >>");
FormField formField = new FormField(this, inName, fieldID, inKids);
formField.FieldElement.EntryV = new Element(new StringAtom(inValue), formField.Host);
return formField;
If inKids.Count = 0 Then
Throw New Exception("Cannot have a group field with no kids")
End If
Dim fieldID As Integer = Doc.AddObject("<< /Kids [] >>")
Dim formField As New FormField(Me, inName, fieldID, inKids)
formField.FieldElement.EntryV = New Element(New StringAtom(inValue), formField.Host)
Return formField
This code snippet is taken from Annotations.cs line 480 in the
Annotations example project.
TextFieldAnnotation textField = new TextFieldAnnotation(this, inRect);
FormField formField = new FormField(this, inName, textField);
formField.FieldElement.EntryFT = "Tx";
formField.FieldElement.EntryFf = (int)Field.FieldFlags.Multiline;
formField.FieldElement.EntryQ = 1;
if (inText != null)
formField.FieldElement.EntryV = new Element(new StringAtom(inText), formField.FieldElement.Host);
return formField;
Dim textField As New TextFieldAnnotation(Me, inRect)
Dim formField As New FormField(Me, inName, textField)
formField.FieldElement.EntryFT = "Tx"
formField.FieldElement.EntryFf = CInt(Math.Truncate(Field.FieldFlags.Multiline))
formField.FieldElement.EntryQ = 1
If inText IsNot Nothing Then
formField.FieldElement.EntryV = New Element(New StringAtom(inText), formField.FieldElement.Host)
End If
Return formField
This code snippet is taken from Annotations.cs line 514 in the
Annotations example project.
CheckBoxAnnotation checkBox = new CheckBoxAnnotation(this, inRect, inValue);
FormField formField = new FormField(this, inName, checkBox);
formField.FieldElement.EntryFT = "Btn";
formField.FieldElement.EntryV = new Element(new NameAtom(inValue ? "Yes" : "Off"), formField.Host);
return formField;
Dim checkBox As New CheckBoxAnnotation(Me, inRect, inValue)
Dim formField As New FormField(Me, inName, checkBox)
formField.FieldElement.EntryFT = "Btn"
formField.FieldElement.EntryV = New Element(New NameAtom(If(inValue, "Yes", "Off")), formField.Host)
Return formField
This code snippet is taken from Annotations.cs line 529 in the
Annotations example project.
List<WidgetAnnotation> kids = new List<WidgetAnnotation>();
for (int i = 0; i < inRects.Length; i++) {
RadioButtonAnnotation radioButton = new RadioButtonAnnotation(this, inRects[i], i.ToString(), i == inSelectedButton);
kids.Add(radioButton);
}
int fieldID = Doc.AddObject("<</FT /Btn /Ff 49152 /Kids [] /DA (/ZaDb 0 Tf 0 g)>>");
FormField formField = new FormField(this, inName, fieldID, kids);
formField.FieldElement.EntryV = new Element(new NameAtom(inSelectedButton.ToString()), formField.Host);
return formField;
Dim kids As New List(Of WidgetAnnotation)()
For i As Integer = 0 To inRects.Length - 1
Dim radioButton As New RadioButtonAnnotation(Me, inRects(i), i.ToString(), i = inSelectedButton)
kids.Add(radioButton)
Next i
Dim fieldID As Integer = Doc.AddObject("<</FT /Btn /Ff 49152 /Kids [] /DA (/ZaDb 0 Tf 0 g)>>")
Dim formField As New FormField(Me, inName, fieldID, kids)
formField.FieldElement.EntryV = New Element(New NameAtom(inSelectedButton.ToString()), formField.Host)
Return formField
This code snippet is taken from Annotations.cs line 1944 in the
Annotations example project.
RichMediaParamsElement pars = RichMediaElement.EntryRichMediaSettings.EntryActivation.EntryConfiguration.EntryInstances[0].EntryParams;
if (string.IsNullOrEmpty(value))
pars.EntryFlashVars = null;
else if (value.Length <= 128)
pars.EntryFlashVars = new Element(new StringAtom(value), AnnotationElement.Object);
else {
StreamObject so = new StreamObject(Form.Doc.ObjectSoup);
so.SetText(value);
so.CompressFlate();
pars.EntryFlashVars = new Element(new RefAtom(so), AnnotationElement.Object);
}
Dim pars As RichMediaParamsElement = RichMediaElement.EntryRichMediaSettings.EntryActivation.EntryConfiguration.EntryInstances(0).EntryParams
If String.IsNullOrEmpty(value) Then
pars.EntryFlashVars = Nothing
ElseIf value.Length <= 128 Then
pars.EntryFlashVars = New Element(New StringAtom(value), AnnotationElement.Object)
Else
Dim so As New StreamObject(Form.Doc.ObjectSoup)
so.SetText(value)
so.CompressFlate()
pars.EntryFlashVars = New Element(New RefAtom(so), AnnotationElement.Object)
End If
|
|
|