Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Writing a document in TIFF format using only native .NET namespaces

Posted on 2013-05-23
3
Medium Priority
?
592 Views
Last Modified: 2013-05-30
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

0
Comment
Question by:David L. Hansen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 56

Accepted Solution

by:
Joe Winograd, EE MVE 2015&2016 earned 2000 total points
ID: 39192852
ImagePrinter Free is free, open-source software distributed under the GNU General Public License (GPL v3):
http://code-industry.net/public/ImagePrinter_2.1.zip

The program's source code is available for download here:
http://code-industry.net/public/ImagePrinter_2.1.src.zip

Download the source and look in the TIFF subfolder (it supports other formats besides TIFF). You will find the C source code there. Grab the code that prints to a TIFF file and either call it from your VB.Net code or convert it into C code. Or you could use the code as a guideline to figure out how to write your own code from scratch. Regards, Joe
0
 
LVL 15

Author Comment

by:David L. Hansen
ID: 39192867
Thanks Joe, I'll look into that.
0
 
LVL 56

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 39192890
Of course, my comment "or convert it into C code" should have said "or convert it into VB.NET code". Mental typo. :)
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question