I Want add annotation in pdf file and show in runtime. how do I do that ?
fallows the code:
Code: Select all
oGdPicturePDF := CreateComObject(CLASS_GdPicturePDF) as _GdPicturePDF;
If oGdPicturePDF.LoadFromFile(WPathImagem, false) = GdPictureStatus_OK Then
Begin
oAnnotationManager := CreateComObject(CLASS_AnnotationManager) as _AnnotationManager;
If oAnnotationManager.InitFromGdPicturePDF(oGdPicturePDF) = GdPictureStatus_OK Then
Begin
//Seleciono a primeira página
oGdPicturePDF.SelectPage(1);
//Crio o Texto
WTextoCarimbo := 'SCANNER ';
WTextoCarimbo := WTextoCarimbo + IntToStr(DayOf(Date))+'/'+IntToStr(MonthOf(Date))+'/'+IntToStr(YearOf(Date));
WTextoCarimbo := WTextoCarimbo + ' as ' + IntToStr(HourOf(Now)) + ':' + IntToStr(MinuteOf(Now)) + ':' + IntToStr(SecondOf(Now));
annot := oAnnotationManager.AddStickyNoteAnnot(6.50,10.80,1.30,0.70,WTextoCarimbo);
oAnnotationManager.SetAnnotationPropertyValue(0, 'FillColor', oGdPicturePDF.SetFillColor(TransparentColorValue));
oAnnotationManager.BurnAnnotationsToPage(True);
oAnnotationManager.SaveAnnotationsToPage();
GdViewer1.ReloadAnnotations;