CurrentAnnotation
IPDFDocument4 :: Annotations

See Also Example
Collapse All

This property gets or sets the current annotation number.

Syntax

LONG CurrentAnnotation { get; set; }
Value
Number of the current annotation

Remarks

The annotation number can be retrieved from any annotation or control creating method, such as AddButton or AddTextAnnotation.

Example

Setting the Current Annotation (Control)

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
b1 := PDF.AddButton(10, 10, 110, 25, 'b1');
b2 := PDF.AddButton(130, 10, 230, 25, 'b2');

PDF.CurrentAnnotation := b1;
PDF.AnnotName := 'Button1';
PDF.AnnotUnicodeCaption := 'Button 1';

PDF.CurrentAnnotation := b2;
PDF.AnnotName := 'Button2';
PDF.AnnotUnicodeCaption := 'Button 2';

PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long b1 = PDF->AddButton(10, 10, 110, 25, "b1");
long b2 = PDF->AddButton(130, 10, 230, 25, "b2");

PDF->CurrentAnnotation = b1;
PDF->AnnotName = "Button1";
PDF->AnnotUnicodeCaption = L"Button 1";

PDF->CurrentAnnotation = b2;
PDF->AnnotName = "Button2";
PDF->AnnotUnicodeCaption = L"Button 2";

PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long b1 = PDF.AddButton(10, 10, 110, 25, "b1");
long b2 = PDF.AddButton(130, 10, 230, 25, "b2");

PDF.CurrentAnnotation = b1;
PDF.AnnotName = "Button1";
PDF.AnnotUnicodeCaption = "Button 1";

PDF.CurrentAnnotation = b2;
PDF.AnnotName = "Button2";
PDF.AnnotUnicodeCaption = "Button 2";

PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
b1 = PDF.AddButton(10, 10, 110, 25, "b1")
b2 = PDF.AddButton(130, 10, 230, 25, "b2")

PDF.CurrentAnnotation = b1
PDF.AnnotName = "Button1"
PDF.AnnotUnicodeCaption = "Button 1"

PDF.CurrentAnnotation = b2
PDF.AnnotName = "Button2"
PDF.AnnotUnicodeCaption = "Button 2"

PDF.SaveToFile "test.pdf", true

See Also

Reference