Visual Basic Development Bookmark and Share   
 Home > Visual Basic General > APIs for Printer Page number
 

APIs for Printer Page number

hi all,

I found a way to get the details of the Document sent to the printers

The owner, Document name, TimeSubmittedetc... Using System.Printing

but the page number iIs there any API s to get the number of Pages

There are vary few documents available for this so any help will be greatlyappreciated

Regards
Roma
roma_victa  Wednesday, November 25, 2009 1:15 PM

Hi roma_victa,

I'm not sure if there is such API,but i thinkyou can count the pages to be printed.
I assume you use the code in the following link
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/f9f7149a-66ed-4b05-acfd-0f5a100393dd
then you can count the page number like this

Public Class Form1

    Private pagecount As Integer = 0
    ...

    Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
        pagecount = pagecount + 1
        ...
    End Sub
End Class
Then you can use pagecount as page number
Besides, for WPF questions youcan try WPF forum for better support.

Hope this helps

Regards
Jeff Shan
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Jeff Shan  19 hours 40 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• what event is fired when a data is loaded into a bound textbox?
• opening UDL files using the ODBC object
• Events being handled by all instances of a child form (possible threading problem)
• Can't Get My SQL Query to work
• Giving pathname of a server to establish connection with DB
• Navigating to a bookmark using WebBrowser component
• Generating Reports using SQL Server 2005 from a VB Application?
• RE: Printing of Excel (Windows Applications)
• Single.Parse(999999999) = 1.0E+8 (100000000.00) ???
• Form Delay help