I am looking for a way to print a document that has been created without saving it. Can this bee done with Spire? See code block below. Don't want to have to save and load file to print.
Private Sub btnSpire_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSpire.Click
Dim dt As Orders.OrderDataDataTable
Dim dr As Orders.OrderDataRow
Dim da As New OrdersTableAdapters.OrderDataTableAdapter
Dim i As Integer
dt = da.GetOrderData()
For i = 0 To dt.Rows.Count - 1
dr = dt.Rows(i)
Dim testDoc As New Document()
addHeader(dr, testDoc)
addStaticRowHeader(testDoc)
insertpic(dr.SMALL_IMAGE, testDoc)
testDoc.SaveToFile(My.Application.Info.DirectoryPath & "\" & i.ToString() & "TEST.doc", FileFormat.Doc)
dv.LoadFromFile(My.Application.Info.DirectoryPath & "\" & i.ToString() & "TEST.doc")
PrintME(My.Application.Info.DirectoryPath & "\" & i.ToString() & "TEST.doc")
Next i
Debug.WriteLine(Now.ToString())
End Sub
Also if you save the document is there a way to print multiple document without showing the print dialog screen for confirmation? if i have ten documents I want all ten to print. the user doesn't need to change or select options because the document is custom.
Private Sub PrintME(ByVal tmpDoc As String)
Dim dialog As New PrintDialog()
Dim result As DialogResult = dialog.ShowDialog()
dialog.AllowCurrentPage = True
dialog.AllowSomePages = True
dialog.UseEXDialog = True
If result = DialogResult.OK Then
Try
dv.PrintDialog = dialog
dialog.Document = dv.PrintDocument
dv.PrintDocument.DefaultPageSettings.Landscape = True
dialog.Document.Print()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If
End Sub