4
47computers
I'm trying to write a small application that will take a given array
of strings (which happen to be URLs, or IDs appended to the end of a
given URL) and will loop through the array with each iteration
navigating a WebBrowser control to that URL and printing it (the
default printer on the machine will be a PDF writer).
However, the problem I'm having is that the code doesn't seem to wait
for the WebBrowser control to load the document. It loops through
immediately and then just prints 4 copies of the last document
(currently, for testing, the array has only 4 elements).
Is there a way to get it to "wait" for the WebBrowser control?
Spawning off threads for this might not be a good idea because when
this goes to a scale testing environment it'll be fetching over 4
million URLs, which I imagine will spawn too many threads.
Or is there perhaps a better way to do what I'm trying to do? (That
is, print a hard copy (PDF) of each report object in our database, of
which there are over 4 million, preserving the various complicated
HTML that gets generated on the fly when viewing a report.)
Any help would be much appreciated, thank you.
Regards,
David
of strings (which happen to be URLs, or IDs appended to the end of a
given URL) and will loop through the array with each iteration
navigating a WebBrowser control to that URL and printing it (the
default printer on the machine will be a PDF writer).
However, the problem I'm having is that the code doesn't seem to wait
for the WebBrowser control to load the document. It loops through
immediately and then just prints 4 copies of the last document
(currently, for testing, the array has only 4 elements).
Is there a way to get it to "wait" for the WebBrowser control?
Spawning off threads for this might not be a good idea because when
this goes to a scale testing environment it'll be fetching over 4
million URLs, which I imagine will spawn too many threads.
Or is there perhaps a better way to do what I'm trying to do? (That
is, print a hard copy (PDF) of each report object in our database, of
which there are over 4 million, preserving the various complicated
HTML that gets generated on the fly when viewing a report.)
Any help would be much appreciated, thank you.
Regards,
David