by lauberth » Wed Nov 09, 2011 4:53 pm
i have downloaded the latest version 8.4
i did a change on the annotation example as i added a function (followint code)
private void tsAnnotation_Click(object sender, EventArgs e)
{
// check a rectangle has been drawn
if (GdViewer1.IsRect())
{
float t_left = 0;
float t_top = 0;
float t_width = 0;
float t_height = 0;
// get the co-ordinates / size of the drawn area
GdViewer1.GetRectCoordinatesOnDocumentInches(ref t_left, ref t_top, ref t_width, ref t_height);
pdf.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch);
pdf.SetOrigin(PdfOrigin.PdfOriginTopLeft);
int annot = pdf.AddLineAnnotation(
t_left,
t_top + t_height,
t_left + t_width,
t_top + t_height,
"mein Kommentar",
"mein erster Kommentar",
PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleCircle,
PdfAnnotationLineEndingStyle.PdfAnnotationLineEndingStyleCircle,
false,
1 / 100,
PdfAnnotationBorderStyle.PdfAnnotationBorderStyleSolid,
0,
0,
1,
255,
0,
0);
GdViewer1.Redraw();
MessageBox.Show(string.Format("annot nr: {0}; anz: {1}", annot, pdf.GetAnnotationCount()));
}
this code is working as it adds an annotation with text and a line without circles.
i save the file in a new pdf and view it with adobe reader, foxit reader where i can see the line and the circles.
if i view it wth gdviewer1.displayfromGDPicturePdf(pdf) i see only the line without the circles.
Another question is: how can i select the annotation within the gdviewer as AnnontationSelected ist not fired. Do i have to check it by myself with mousemove events checking against the properties of the annotations (rectangles)
i tried to Attach the pdf which is not working.
btw. if i view the pdf in foxit and save it again / the circles are shown in gdviewer on reviewing the pdf
rgds
Thomas