Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 513
  • Last Modified:

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

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
gwosgood
Asked:
gwosgood
  • 2
1 Solution
 
ladarlingCommented:
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
 
gwosgoodIT MgrAuthor Commented:
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
 
ladarlingCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now