Following is the code supplied in the GdPicture examples:
Code: Select all
Dim annot As AnnotationRubberStamp = oAnnotationManager.AddRubberStampAnnot(Color.Red, 0, 0, oGdPicturePDF.GetPageWidth / 72, oGdPicturePDF.GetPageHeight / 72, "APPROVED")
Code: Select all
Dim annot As AnnotationRubberStamp
annot = oAnnotationManager.AddRubberStampAnnot(-16777216, 0, 0, 3, 3, "APPROVED")
Code: Select all
oAnnotationManager.AddRubberStampAnnot -16777216, 0, 0, 3, 3, "APPROVED"
Any help to get me over this hump would be appreciated. I'm am currently evaluating this software and without understanding why this will not work I can't move forward.
Complete code from the GdPicture website follows:
Code: Select all
'The following code assumes that a GdViewer called GdViewer1 has been painted on the form.
Dim oGdPicturePDF As New GdPicturePDF
oGdPicturePDF.LoadFromFile("c:\test.pdf", False)
GdViewer1.DisplayFromGdPicturePDF(oGdPicturePDF)
Dim oAnnotationManager As New AnnotationManager
oAnnotationManager.InitFromGdViewer(GdViewer1)
oAnnotationManager.SelectPage(1)
Dim annot As AnnotationRubberStamp = oAnnotationManager.AddRubberStampAnnot(Color.Red, 0, 0, oGdPicturePDF.GetPageWidth / 72, oGdPicturePDF.GetPageHeight / 72, "APPROVED")
annot.Rotation = 20
oAnnotationManager.SaveAnnotationsToPage()
oAnnotationManager.Close()
GdViewer1.Redraw()
Code: Select all
Dim Forecolor As Long
Dim oGdPicturePDF As New GdPicture_NET_10.GdPicturePDF
Dim oAnnotationManager As New annotationManager
oGdPicturePDF.LoadFromFile "c:\_temp\DOC120613.pdf", True
GdViewer8.DisplayFromGdPicturePDF oGdPicturePDF
oAnnotationManager.InitFromGdPicturePDF oGdPicturePDF
oAnnotationManager.SelectPage 1
Forecolor = GdViewer8.ARGBI(255, 0, 0, 0)
'
' Calling the following without using the AnnotationRubberStamp return value
' works just fine
'
oAnnotationManager.AddRubberStampAnnot Forecolor, 0, 0, 3, 3, "APPROVED"
'
' Calling the following attempting to set the AnnotationRubberStamp
' return value to a AnnotationRubberStamp object causes a
' run-time error '91', object or with block variable not set
'
Dim annot As AnnotationRubberStamp
annot = oAnnotationManager.AddRubberStampAnnot(Forecolor, 0, 0, 3, 3, "APPROVED")
annot.Rotation = 20
oAnnotationManager.SaveAnnotationsToPage
oAnnotationManager.Close
GdViewer8.ReloadAnnotations
GdViewer8.Redraw