I am developing an application which downloads pdf files, then water marks and then print. Downloading part is completed using internet controls and water marking also done using itextsharp dll. With the following code I am able to set the printer also.

Public Function SetPrinter(ByVal prtName As String) As Boolean
        Dim s As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser
        Dim m As Microsoft.Win32.RegistryKey

        m = s.OpenSubKey("Software")
        m = m.OpenSubKey("Microsoft")
        m = m.OpenSubKey("Windows NT")
        m = m.OpenSubKey("CurrentVersion")
        m = m.OpenSubKey("Windows", True)
        m.SetValue("Device", prtName & ",winspool,FILE:")

        m.Flush()
        m.Close()
        s.Close()
    End Function

But when it comes to pdf printing its causingproblem becoz I have to print multiple documents. I used AxAcroPDF viewer to print but next line is executed before the print command completes. I dnt want to make my code bulky using sleep or timer command. Is there any good way to print multiple pdfs with page select (like age 1 -5).

Thanks/Regards

SGM

i have just i dea that may be help full for you try to count no of pages from ur printer and then start loop in decreament untill unless ur no of total print page become zero hope it will help u

Hi,

You can find an example how to print pdf files in this thread.

I have checked this also. but as I mentioned earlier timeout and all causes problem.sometimes it prints in few seconds (due to small file size or local printer), sometimes it may take minutes to complete. so I cannot predict the exact timing to print a pdf. but other major problems are, you cannot set fit to the page, and select the pages you want to print.

Do you know any freeware ocx (just like I used pdf.ocx for vb6) for Vb.net for viewing pdf and then print.

Thanks

SGM

This article has been dead for over six months. Start a new discussion instead.