Results 1 to 4 of 4

Thread: Drawline on AxAcroPDF Control

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    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

  2. #2

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    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.

  3. #3

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    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

    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

  4. #4
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    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:
    1. Dim gr As Graphics = Graphics.FromHwnd(ActiveXControlHandle)
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width