Page 1 of 1

Put Annotation and Show on Code

Posted: Thu Sep 20, 2012 6:39 pm
by Diego
Hi,

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;

Re: Put Annotation and Show on Code

Posted: Sun May 19, 2019 9:00 pm
by Gabriela
Hi,

Please find fully working sample applications in the installation package:
Sample Guide Overview