Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-08
5
Medium Priority
?
507 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
[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
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

718 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