Link to home
Create AccountLog in
Avatar of David L. Hansen
David L. HansenFlag for United States of America

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)?
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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of David L. Hansen

ASKER

Thanks Joe, I'll look into that.
Of course, my comment "or convert it into C code" should have said "or convert it into VB.NET code". Mental typo. :)