Home > Computing > BSPrinter: New component for VB6 developers that adds Print Preview ability and saves PDF files

BSPrinter: New component for VB6 developers that adds Print Preview ability and saves PDF files

Added: (Mon Sep 21 2020)

Pressbox (Press Release) -

Print preview and save PDF files in Visual Basic 6



Visual Basic 6 is old, but still very powerful and many developers use it.

Now a new component came around, BSPrinter, that adds the ability to have print preview with VB6's Printer object.



It works with total backward compatibility with the original Printer object.

It also automates things like adding page numbers and setting margins, features that VB6 never had before (by itself).



Other features that this new component adds is the ability to print flex grids (MSFlexGrid, MSHFlexGrid and compatibles) with just one line of code.

Also it can print Rich textboxes (RichTextBox) in the same way. Off course, all with print preview.

And another interesting feature is that it can save PDF files (on Windows 10) without user interaction, so the developer only needs to focus on the content, and print everything like before using the Printer object, but now with these new features available.



The result is a program much improved from the end user point of view.

It has a cost, but how many more licenses of your program would be sold with these improvements?



For Visual Basic 6 developers it worths a try.




How to implement it?



The first step is to install BSPrinter or to manually register the OCX on Windows.

You can download it from this page.

Next step is to open the VB6 IDE and add the component to a project.

Then, add a PrintPreview control to a form.

Double click on it and you'll see the PrepareReport event procedure.

Call the printing procedure from there, or add the code on this event code.

You can use any of the Printer.* methods, or the new one offered by the component in PrintPreview1.*.

A full specification can be found at BSPrinter reference page.



The installer also installs many sample projects, they can be found oin the program folder under [Program files]/BSPrinter or [Program files x86]/BSPrinter on Windows 64 bits.



They are:



1 - Hello World

2 - Positioning on page

3 - Print FlexGrid

4 - Print RichTextBox

5 - Save PDF file

6 - Full backward compatibility

7 - Show more pages by default

8 - Print using PrintEx method (for printing Unicode and more)

9 - Allow or disallow user actions

10 - Show margins

(and more)

Submitted by:Javier Balkenende
Disclaimer: Pressbox disclaims any inaccuracies in the content contained in these releases. If you would like a release removed please send an email to remove@pressbox.com together with the url of the release.