Drawline on AxAcroPDF Control
I have a AxAcroPDF on a from which i added from the toolbox
I can draw on the form using this code
Code:
Private m_Drawing As Boolean = False
Private m_LastPoint As Point = Nothing
' Start drawing.
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs) Handles _
Me.MouseDown
m_Drawing = True
m_LastPoint = New Point(e.X, e.Y)
Dim gr As Graphics = Me.CreateGraphics()
gr.Clear(Me.BackColor)
End Sub
' Continue drawing.
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs) Handles _
Me.MouseMove
If Not m_Drawing Then Exit Sub
Dim gr As Graphics = Me.CreateGraphics()
gr.DrawLine(Pens.Blue, m_LastPoint, New Point(e.X, e.Y))
m_LastPoint = New Point(e.X, e.Y)
End Sub
' Stop drawing.
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs) Handles _
Me.MouseUp
m_Drawing = False
End Sub
Is it possible to draw directly onto the AxAcroPDF Control?
The AxAcroPDF Control dosnt have the mouseup and mouse down declatations so i am unable to easily adapt the code.
regards
toe
Re: Drawline on AxAcroPDF Control
So far i have tried putting a picturebox, a panel and a rectangle control on top of the AxAcroPDF Control and set there backcolor property to transparent but they take on there containers backcolor which is the form.
I have also tried a combination of making different controls the parent for each other without any luck
Anyone got any suggestions on getting this to work?
I know it is possible as i have seen software that will do this. Maybe they had to purchase a special license.
Re: Drawline on AxAcroPDF Control
mmm
i just received this email from About.com Visual Basic
http://visualbasic.about.com/od/quic...sppdf.htm?nl=1
Quote:
Since the PDF format is a competitor to Microsoft's technology, they don't provide a lot of support and you have to get a software object that "understands" the PDF format from someone other than Microsoft right now. Adobe returns the favor. They don't support Microsoft technology all that well either. Quoting from the latest (October 2009) Adobe Acrobat 9.1 documentation, "There is currently no support for development of plug-ins using managed languages such as C# or VB.NET." (A "plug-in" is an on-demand software component. Adobe's plug-in is used to display PDF's in a browser.")
So it seems i wont get much help on this.
o well one for the scrap pile :(
Re: Drawline on AxAcroPDF Control
I don't have acrobat so I can't test it, but maybe try creating a graphics object from the handle of the axtivex control then draw to it...
vb Code:
Dim gr As Graphics = Graphics.FromHwnd(ActiveXControlHandle)
kevin