Solved

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

Posted on 2008-10-08
5
485 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 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

12 Experts available now in Live!

Get 1:1 Help Now