Q:
I have the code working, but it is not showing the annotation in RED,
it is showing in White. I have the RGB as 1.0, 0, 0 which should be
red. Do you see anything obvious that would be causing the annotation
to be white?
'build annotation object from XML file
Dim _objInk As objInk = buildAnnotationObjectFromXML()
'recreate the annotation on the current document in the viewer
Dim doc As PDFDoc = _pdfview.GetDoc()
Try
'Dim first_page As Page =
olddoc.GetPage(_objInk.intPageNumber)
Dim first_page As Page = doc.GetPage(1)
Dim ink As pdftron.PDF.Annots.Ink =
pdftron.PDF.Annots.Ink.Create(doc.GetSDFDoc(), New
Rect(_objInk.Rect.x1, _objInk.Rect.y1, _objInk.Rect.x2,
_objInk.Rect.y2))
ink.SetColor(New ColorPt(1.0, 0.0, 0.0), 1.0)
Me.ListBox1.Items.Add("Date Added: " +
_objInk.strDate)
ink.SetSubject("Annotation")
ink.SetTitle("Test Annotation")
For x As Integer = 0 To _objInk.ink.PathCount - 1
For y As Integer = 0 To
_objInk.ink.Path.Item(x).intNumPoints - 1
Dim pt As New
pdftron.PDF.Point(_objInk.ink.Path.Item(x).listPoints(y).x,
_objInk.ink.Path.Item(x).listPoints(y).y)
ink.SetPoint(x, y, pt)
Next
Next
first_page.AnnotPushBack(ink)
-------------
A:
You may want to try the following line:
ink.SetColor(New ColorPt(1.0, 0.0, 0.0), 3.0)
The last parameter in SetColor (i.e. 3) indicates that RGB color space
(with 3 components) should be used.
On Apr 3, 4:24 pm, Support <inin...@pdftron.com> wrote:
Q:
Do you guys have a sample usingGetPointCountand GetPoint or an
'pdftron.PDF.Annots.Ink' annotation object? I want to seralize PDF
annotations in my XML annotation format.
-----------------
A:
I couldn't locate any sample code but it should be relatively
straightforward. For example:
Ink a= (Ink)ink_annot;
int num_paths = a.GetPathCount();
for (int i=0; i< num_paths; ++i) {
int points = a.GetPointCount(i);
for (int j=0; j< num_paths; ++j) {
Point p = a.GetPoint(i, j);
}
}