I am trying to print multiple pdf’s which I retrieve using a url (eg: https://myurl.com/12345.pdf) for each file using the HTMLViewer.
I can load the pdf in HTMLViewer with no problem. Printing from the HTMLViewer works. There is some offset when printed which seems to be related to the position of the HTMLViewer in the current window.
If possible, I would like to print all the PDF’s without showing the Print Dialog.
I tried to save the PDF’s in a file, but the file created is empty (0 kb) using the code below:
For i as Integer = 0 To SelectedRows.Ubound //Items in a listbox selected to print
If Left(Listbox1.CellTag(SelectedRows(i),1),6) = "https:" then //CellTag contains the url of the PDF file
Dim f as FolderItem = SpecialFolder.Temporary.Child("source"+Str(i)+".pdf")
Dim url as String = Listbox1.CellTag(SelectedRows(i),1)
Dim http As New HTTPSecureSocket
http.Get(url,f)
End If
Next
I also found that when looping through the HTMLViewer.print, looping through the list proceeds too fast to print more than one document. It seems that I would have to create a pause that waits for the document to complete printing, but I am not exactly sure how that is accomplished.
Any recommendations?