Adding an Annotation (StickyNote) to a PDF Document

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
craigb
Posts: 5
Joined: Tue Jan 09 2007

Adding an Annotation (StickyNote) to a PDF Document

Post by craigb »

Hi

I have the below code that I need to use to create a Annotation on an existing PDF document.

It works, however the annotation has no text????? It is just a blank annotation.

Can anyone please help me???

-----------------------------------------------

pdfCreator1.Document.CurrentPage.CreateObject(IacObjectType.acObjectTypeStickyNote, "Hello");

IacAttribute attr = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Note Top");
attr.Value = 1000;
IacAttribute attr1 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Note Left");
attr1.Value = 1000;
IacAttribute attr2 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Note Right");
attr2.Value = 5000;
IacAttribute attr3 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Note Bottom");
attr3.Value = 5000;

IacAttribute attr4 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("text");
attr4.Value = "Hello my name is craig";

IacAttribute attr5 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Icon Top");
attr5.Value = 1000;
IacAttribute attr6 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Icon Left");
attr6.Value = 1000;
IacAttribute attr7 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Icon Right");
attr7.Value = 5000;
IacAttribute attr8 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Icon Bottom");
attr8.Value = 5000;

IacAttribute attr9 = pdfCreator1.Document.CurrentPage.ObjectByName("Hello").AttributeByName("Open");
attr9.Value = true;

SaveFileDialog dialog = new SaveFileDialog();

dialog.Filter = "pdf files (*.pdf)|*.pdf|All files (*.*)|*.*";
dialog.FilterIndex = 1;
dialog.RestoreDirectory = true;

if (dialog.ShowDialog() == DialogResult.OK)
{
pdfCreator1.Document.Save(dialog.OpenFile(), IacFileSaveOption.acFileSaveDefault);
}
Post Reply