Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET - Error - Object not set in Module 4 40
Sql server insert 13 37
Visual Studios 1 77
Toolbar to format all windows forms controls at design time needed 5 16
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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