printing from gdviewer

Discussions about GdPicture.NET usage in non managed applications built in vb6, Delphi, vfp, MFC c++ etc...
Post Reply
glnoble
Posts: 11
Joined: Tue May 01, 2012 3:02 pm

printing from gdviewer

Post by glnoble » Fri Jun 15, 2012 2:53 am

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: printing from gdviewer

Post by Loïc » Fri Jun 15, 2012 10:33 am

Print is a reserved keyword in vba. Therefore we've implemented a new function that should be used instead: PrintInterop() ;)

glnoble
Posts: 11
Joined: Tue May 01, 2012 3:02 pm

Re: printing from gdviewer

Post by glnoble » Fri Jun 15, 2012 6:47 pm

worked perfectly, quick response and good advice, very thankful!

johnmcrin
Posts: 4
Joined: Tue Apr 17, 2012 5:37 pm

Re: printing from gdviewer

Post by johnmcrin » Sat Aug 04, 2012 8:39 pm

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?

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: printing from gdviewer

Post by SamiKharma » Sat Aug 04, 2012 9:11 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest