Hi,
We have looked into your sample project. There are a number of issues with your code. The most important issue is you have two WebView objects in your project: WebView1 and WebView2. You are loading your Url into WebView2 (WebControl1.WebView is assigned to WebView2), but you are calling Print on WebView1. So you will need to fix that first.
The second issue you have is you can not call Print immediately after setting WebView.Url because loading the page is not instant. You need to wait until the Url finishes loading first before you can call Print.
The third issue is you can not trigger these kind of tasks with a timer. Because loading a Url and printing a page takes time and it can take different amount of time during each iteration, you will need to wait for each step to finish before you start another step. The easiest way for you to do this is to use async feature. For example, the following code demonstrates how to load and print 10 pages one after another:
Code: Visual Basic.NET
Private Async Sub LoadAndPrint10Pages(ByVal webView As WebView)
For i As Integer = 1 To 10
'You may need to have some kind of mechanism to exit this
'For loop half way. For example, User may want to close your
'application only after 5 print tasks, to handle that situation
'you may need to set a flag when user closes the form and then
'check that flag here so that you can exit the for loop early
If ShouldStop() Then Exit For
'Load and wait for the page to finish loading
Await webView.LoadUrlAsync(pageUrl & "?page=" & i.ToString())
'Start print and wait for the printing job is sent to the printer queue
Await webView.PrintAsync()
Next
End Sub
Note that you must reference EO.Extensions.dll and also use .NET 4.6 and above in order to use the async feature.
Hope this helps. Please feel free to let us know if you have any more questions.
Thanks!