Posted 6 May 2019, 4:04 am EST
Hi,
i use C1PdfDocumentSource to print out an existing PDF file from disk. This worked for a while and is still working on other test machines. But it has started to crash the “COM Surrogate” (DllHost.exe) process on the production machine.
The machine in question where this happens is a Windows Server 2012 R2. We use .NET 4.7.1 with Visual Basic.
This is the simple code i am using:
Using doc As C1.Win.C1Document.C1PdfDocumentSource = New C1.Win.C1Document.C1PdfDocumentSource()
Dim pSettings As Printing.PrinterSettings = New Printing.PrinterSettings With {
.PrinterName = "Printer Name"
}
Try
doc.LoadFromFile("test.pdf")
doc.Print(pSettings)
Catch ex As Exception
MessageBox.Show(ex.Message, "PDF Print", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Using
What would cause this error and is there a way to workaround this? Also is this the recommended way to print out PDFs with Component One?