Solved

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

Posted on 2013-05-23
3
587 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 54

Accepted Solution

by:
Joe Winograd, EE MVE 2015&2016 earned 500 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 54

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

728 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