Solved

Printing a .txt file with a pre-rendered overlay file

Posted on 2008-10-08
5
482 Views
Last Modified: 2012-05-05
Greetings Experts;

I have written an application in VB.NET 2005 that generates Bill Of Lading documentation.  The VB app creates a .txt file with rtf formatting information and saves it into a designated folder that a third-party application has permissions to see.  This third-party app merges my text file with a pre-rendered pcl template file (of my design, created in MS publisher) and sends it to the printer.  The end-effect bing one "complete" document; my raw .txt data laid on-top-of a blank Bill Of Lading template.

My question is this:  Can I produce these results myself without the use of this third-party software?  The licensing fees are on a per-machine basis; if I could master this printing technique on my own I could save my company a lot of licensing expense and expand my own application abilities.  I am not familiar with the .NET PrintDocument component, but from what little I have read in the documentation, this looks to be a possible solution.

Any help on this matter would be greatly appreciated.  Thank you in advance for your support and knowledge.
0
Comment
Question by:gwosgood
  • 2
5 Comments
 
LVL 11

Expert Comment

by:ladarling
ID: 22681132
Can I produce these results myself without the use of this third-party software?
The short answer is yes, you can.
You are probably going to want to steer clear of the PCL filetype when prototyping an app like this, and use some other standard image (bmp, png, etc) or document format that you can more easily manipulate with VB.  The print capabilities are extensive, and you would do yourself a favor by getting to know them in depth, especially the printdocument class.  
Here is a quick and dirty printing sample:
http://www.vbdotnetheaven.com/UploadFile/mgold/PrintinginVBNET04202005015906AM/PrintinginVBNET.aspx
 
 
0
 
LVL 2

Author Comment

by:gwosgood
ID: 22681321
ladarling,

Thank you for your feedback.  I am already somewhat familiar with the PrintDocument component, however the link you provided only details basic print functions.  I am looking for a way to print both user-input and a graphical underlay image to the SAME page.

Layer 1 = graphic underlay (company logo, tidy grid representation, legal print)
Layer 2 = user-input data (customer ship information, package description)

Layer 1 + Layer 2 = printable, readable Bill of Lading that can be directly handed to customer

I need a process that will combine Layer 1 with Layer 2 and print the resulting image.  As a bonus, I am also interested in saving the combined image file for referential accountability.
0
 
LVL 11

Accepted Solution

by:
ladarling earned 500 total points
ID: 22681489
The *easiest* way to get started might be with the PrintForm control. That would let you visually design it as a standard windows form and then print like a document.
http://msdn.microsoft.com/en-us/vbasic/bb735936.aspx
You might also want to check out RDLC and the ReportViewer control, which also let you visually manipulate the document.
The Layers you are talking about are just going to be objects, plain and simple. VB and C# understand layering to be analogous to Z-order (Bring to front, send to back). So, actually, your friends are going to be controls such as ImageBox, Background Image, Labels, etc.
 If you need to save a copy there are any number of avenues you could take. You would probably want a PDF or other document format printer driver on your system for document 'share-ability', or you could manually write an export function for a proprietary format.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now