how to put image sign by drag and drop

Technical support for Spire.PDFViewer

Moderator: iceblue support

how to put image sign by drag and drop

Postby blueeyeswhite » Thu Aug 10, 2017 9:28 am

is there a way to put electronic signature dyamically ? (drag and drop)
just like https://www.howtogeek.com/164668/how-to-electronically-sign-documents-without-printing-and-scanning-them/ especially adobe acrobat ?

i try to implement it, but no luck. still set image to static (specific coordinate). by allowing drop `PdfViewer1.AllowDrop = True`

Code: Select all
    Private Sub PdfViewer1_DragDrop(sender As Object, e As DragEventArgs) Handles PdfViewer1.DragDrop
        Dim picbox As PdfViewer = CType(sender, PdfViewer)

        Dim files As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
        Dim fil As String = files(0).ToString
        Dim pdfdoc As New PdfDocument
        pdfdoc.LoadFromFile("c:\cust.pdf")

        Dim pdfpage As PdfPageBase = pdfdoc.Pages(0)
        If files.Length <> 0 Then
            Try
                Dim pdfimg As PdfImage = PdfImage.FromFile(fil)
                pdfpage.Canvas.DrawImage(pdfimg, 562, 50, 40, 33)
                pdfdoc.SaveToFile("C:\Users\xxx\Desktop\asd.pdf")
            Catch ex As Exception
                MessageBox.Show("Problem opening file ")
            End Try
            MsgBox("a")
        End If

    End Sub

    Private Sub PdfViewer1_DragEnter(sender As Object, e As DragEventArgs) Handles PdfViewer1.DragEnter
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.Copy
        Else
            e.Effect = DragDropEffects.None
        End If
    End Sub


blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Re: how to put image sign by drag and drop

Postby Gary.zhang » Thu Aug 10, 2017 10:02 am

Hello,

Thanks for your inquiry. The pdfviewer is just a viewer, not editor, sorry that it doesn't support to edit the elements.

Sincerely,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1345
Joined: Thu Apr 04, 2013 1:30 am

Re: how to put image sign by drag and drop

Postby blueeyeswhite » Fri Aug 18, 2017 6:25 am

so what component should i use ? what's the approach for this problem ?
thanks
blueeyeswhite
 
Posts: 15
Joined: Mon Jun 19, 2017 9:03 am

Re: how to put image sign by drag and drop

Postby Gary.zhang » Fri Aug 18, 2017 7:39 am

Hello,

Sorry that our product doesn't have the visual operating interface, you only use the our Spire.Pdf product to set image to static (specific coordinate) programmatically.

Sincerely,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1345
Joined: Thu Apr 04, 2013 1:30 am


Return to Spire.PDFViewer

Who is online

Users browsing this forum: No registered users and 0 guests