David L. Hansen
asked on
Writing a document in TIFF format using only native .NET namespaces
I have a VB.Net program which uses a third-party "print to file" object to create some TIFF files. This object is failing randomly (apparently randomly that is). Every so often it just prints a blank document (no errors, it's just blank). If I recreate the scenario exactly, it will run fine...usually. Bottom line is that I want to abandon this 3rd party tool and just use pure .NET to do the job. I don't know how though.
I've posted the essential code below of how I use this defective "ImageConverter" object. How can I swap this out for pure .NET and still get a TIFF image (yes, it must be a TIFF file)?
I've posted the essential code below of how I use this defective "ImageConverter" object. How can I swap this out for pure .NET and still get a TIFF image (yes, it must be a TIFF file)?
Imports System.Drawing.Printing
Dim WithEvents PrintDoc As New System.Drawing.Printing.PrintDocument
Dim ImageConverter As New badPDFPrinter
With ImageConverter
.OutputFormat = badPDFOutputFormatEnum.TIFFG32d
.Settings.OpenDocumentAfterCreation = False
.ApplySettingsBeforePrint()
End With
PrintDoc.PrinterSettings.PrinterName = ImageConverter.PrinterName
PrintDoc.Print()
ImageConverter.WaitUntilDocumentIsPrinted() 'prevents the biopdf user interface from launching
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Of course, my comment "or convert it into C code" should have said "or convert it into VB.NET code". Mental typo. :)
ASKER