VBGold ASP Printer Examples
Print Text Document With Title, Header, Footer, etc.
This example demonstrates how to print a text document with title, body, header and footer, with different font settings for each one of the document parts.
Document Title:
Title Font:
Document Header:
Header Font:
Document Footer:
Footer Font:
Document Body:
Smart Print Control is a 32-bit ActiveX (OCX) control that greatly simplifies printing tasks such as printing Reports, Text Files, Rich Text Format (RTF) Files and RTF Data, HTML Files and long text strings from within your Visual Basic, Delphi and Visual C++ applications. If you are a Visual Basic developer, you already know the headache associated with using the VB Printer object to print your documents, where you need to write complex code to figure out how to format each line of text to fit on the paper, based on the font face and size used, type of printer, paper size, orientation, document margins, number of pages required, etc. With Smart Print Control, you just supply the document title, document text (body), and optionally document header and footer, at design-time or at run-time and you are done. Moreover, Smart Print Control enables you to easily print any text file, RTF file, RTF data, or HTML file with just a single line of code! It can't get easier with printing from your Visual Basic applications! Smart Print Control provides great flexibility in printing your documents, by allowing you to query all local and network printers, select a printer, specify print quality, paper size, orientation, paper bin, print margins, line spacing, etc. Take a look at the great of Smart Print Control. Smart Print Control automatically formats the document text, including the document title, header and footer, based on the specified font faces, sizes, etc. and automatically word-wraps text so that lines are appropriately fit on the paper, taking into consideration the paper size and paper orientation of the selected printer. In addition to printing text files, the new version (4.x) of Smart Print Control enables you to print Rich Text Format (RTF) files, RTF Data and HTML files in full color with just one line of code!. You only need to specify the file name and call the PrintDoc method, or just call the PrintRTFFile, PrintRTFData or PrintHTMLFile method to print RTF and HTML files. Smart Print Control can be used in any 32-bit programming language that support ActiveX (OCX) controls, such as Visual Basic 4 (32-bit), VB5, VB6, Visual C++, Delphi, etc. Smart Print Control Features: - Smart Print Control provides you with great flexibility in printing your documents, by allowing you to: - Print text supplied from within your code, from a text box, label control or other controls on your form, or text supplied by the user - Print text files of any size by just using the FileName property of the control - Print Rich Text Format (RTF) files and RTF data with WYGIWYS (What You Get Is What You See) by just using the FileName property of the control or calling the PrintRTFFile method - Print HTML files including any text and images (as seen in a web browser) by just using the FileName property of the control or calling the PrintHTMLFile method - Print documents by retrieving some or all document data directly from a text file - Specify a different font name, font size, bold, italic, charset etc. for each one of the document title, text, header and footer separately - Specify the document top, bottom, left, and right margins separately - Query all physical and logical printers installed on your system (retrieve the names and number of printers), as well as network printers - Select the printer device to print to, if there are more than one printer installed on your system - Select the paper bin (from among 12 standard printer paper bin types) - Select the paper size (from among 20 standard paper sizes) - Select the paper orientation (portrait or landscape) - Select the print quality (draft, low, medium, or high) - Specify the line spacing (single, 1.5 lines or double spacing) - Specify the number of copies to print - Print page numbers - Print a border around the document with a specified line width - Include the current (system) date and time in the document footer - Print a separating line below header and above footer with a specified line width - Notifies you about the printing progress (which page is currently being printed) - Notifies you when any errors occur while sending the document to the printer and when the printing is completed
Body Font:
Body Line Spacing:
(Valid values are: 1, 1.5, 2)
Paper Orientation:
(Valid values are: 1=Portrait, 2=Landscape)
Copyright 2004 - 2005
VBGold Software
- All rights reserved.