I working with PdFDocumentVIew.
I made simple code.
PDFDocument = New PdfLoadedDocument(My.Resources.dummy_pdf_1)
If PdfDocumentView1.LoadedDocument IsNot Nothing Then
PdfDocumentView1.Unload()
End If
PdfDocumentView1.Load(PDFDocument)
Dim page As PdfLoadedPage
page = PDFDocument.Pages(PdfDocumentView1.CurrentPageIndex - 1)
Dim g As PdfGraphics = page.Graphics
Dim pen As New PdfPen(Color.Red)
g.DrawLine(pen, New Point(100, 100), New Point(200, 100))
' Invalidate()
PdfDocumentView1.Refresh()
It's working like I intend but when i divide code to parts I received error which i cant solve.
Every test is launched on "clear" app.
When i use ATTEMPT3, its working.
When I use ATTEMPT1, ATTEMPT2 the red line doesnt appear.
When I use ATTEMPT1, ATTEMPT2, ATTEMPT3 I received error which is posted above.
Also I cant catch any event on PDFDocumentView, I click everywhere on control and PdfDocumentView1.MouseClick event didnt raise.
Attachment:
PDFDocumentViewTest_571ad430.zip