Page 1 of 1

printing from gdviewer

Posted: Fri Jun 15, 2012 2:53 am
by glnoble
we are doing a com version 5 to .net V8 conversion. In our application we allow the user to open a PDF using the viewer then locate a page then click a print button to print the current page being viewed.

The simple function is below. the logic worked perfectly in com version 5 but I am getting an error of "Object doesn't support this property or method". Its the gdviewer1.print line which is throwing the error.

Our development system is Windows 7 64bit, using Microsoft Access 2010, running the newest version of gdpicture. The function is below:

Code: Select all

Private Sub print_one_Click()
On Error GoTo Handler_Err
   
    If Print_cancel = False Then 'ok to use viewer to print
        If GdViewer1.PrintSetActivePrinter(Application.Printer.DeviceName) Then
            Me!xresponse.Caption = ""
            GdViewer1.PrintSetFromToPage GdViewer1.CurrentPage, GdViewer1.CurrentPage
            GdViewer1.Print
        Else
            Me!xresponse.Caption = "Unable to set printer"
        End If
    End If

Handler_Exit:
    Exit Sub
Handler_Err:
Call err_log_entry(Err.Number, Err.Description, "image pop print 1")
Resume Handler_Exit
End Sub

Re: printing from gdviewer

Posted: Fri Jun 15, 2012 10:33 am
by Loïc
Print is a reserved keyword in vba. Therefore we've implemented a new function that should be used instead: PrintInterop() ;)

Re: printing from gdviewer

Posted: Fri Jun 15, 2012 6:47 pm
by glnoble
worked perfectly, quick response and good advice, very thankful!

Re: printing from gdviewer

Posted: Sat Aug 04, 2012 8:39 pm
by johnmcrin
I would like all of the pan and zoom actions in one viewer to be mirrored identically in the second viewer, and vice versa. Is there an existing mechanism to handle this?

Re: printing from gdviewer

Posted: Sat Aug 04, 2012 9:11 pm
by SamiKharma
Hi,

Even though your question should not be in this post, but in an individual post, here it the answer:
viewtopic.php?t=3800

Best Regards,
Sami