gbPrintPreview
gbPrintPreview allows programmers to add print preview of text files to their applications.
A DLL version of gbPrintPreview is available and can be easily added to easily applications with
only a few modifications to the calling application. Source code is also available, allowing
gbPrintPreview features to be integrated directly into PowerBASIC applications." A stand alone file
viewer, which demonstrates gbPrintPreview features, is also included in the gbPrintPreview distribution
file.
Preview of files can be done at various zoom factors, up to 400%. Header and footers are supported, each
with the option to include text or images. Printer selection, margin setting, portrait/landscape
selection, page numbering are just a few of gbPrintPreview's features. Printing of individual pages, a
page range, or the entire document is supported.
gbPrintPreview uses a single window, consisting of a toolbar and a display of one page from the text
document.
Feature List
gbPrintPreview provides a variety of features.
- Preview and/or print text files
- Print entire document, specific page, or range of pages
- Printer selection
- Display any single page in preview display
- Portrait/landscape orientation
- Optional header and/or footer areas
- User-selectable fonts
- Zoom Factors to 400%
- Special zoom factor Page - entire page in display
- Special zoom factor Width - page always same width as display
- Optional display of margins, header/footer and non-printable area outlines
- Text and background color selection
- Separate fonts for header, footer and main text
- Optional header/footer titles (left, center and right positions)
- Automatic insertion of custom titles(date, time, page number and filename)
- Image support - header, footer, or page background
- Image support include bmp, gif, jpg and png image types
- Margins may be modified - Upper, Lower, Left, Right
- Optionally apply wordwrap to text content
- Display printer dialog for selected printer
- Quiet printing - print without opening Print Preview dialog
- Specify initial printer settings - printer, orientation, paper size, margins
- Support for "Form Feed" command embedded in text file
- Optional line numbers
- Sort lines
- Left justify lines
- Save as-displayed text to file
- Save current page text to file or copy to clipboard
- Save current image to clip or to file (as BMP or JPG)
- Open new file within print preview
- Available as standalone application, DLL, and PowerBASIC Source Code
- Application control of initial Print Preview dialog size and location
- Online Help
Using gbPrintPreview
gbPrintPreview ...
Toolbar
Most gbPrintPreview features and settings are accessed through the toolbar buttons.
- Printer - Opens printer selection dialog
- Settings - Opens settings dialog
- Prior - Displays prior page
- Next - Displays next page
- All - Prints all pages
- Page - Prints current page
- Range - Prints specified range of pages
- Zoom - Cycles through all zoom settings. Individual settings can be selected using the
Zoom button dropdown menu
- Portrait - Selects portrait orientation. Landscape is used if not pressed.
- Header - Display header
- Footer - Display footer
- Margins - Display margin outlines
- WordWrap - Apply wordwrap to text display
- Cancel - Close Print Preview dialog without printing
- Help - Open this online Help page
Settings Dialog
Pressing the Settings button will display the following dialog. Changes may be saved and
applied on exit from the dialog, or, changed may be made effective while the dialog is being
displayed.
Main Body
- Portrait
toggles between portrait and landscape paper orientations
- Gray Scale
toggles conversion of background image to gray scale
- Text Color
opens a dialog from which to select the color of text. The color is
applied to the entire document. Click on the colored label to open the color dialog.
- AutoClose
directs gbPrintPreview to close when any page option (all, page, range) is
chosen
- BG Color
opens a dialog from which to select the background color. Click on the colored label to open the color dialog.
- Line Numbers
toggles display of line numbers. The numbers are displayed to the left of
the text area and will print if visible when a printing option is selected
- Show BG Image
toggles display of the background image
- Margin Outlines
displays lines on the page, showing the edged of dead zones, headers,
footer, borders and the main text area
- Custom FF
enables detection of the custom form feed, as entered in the textbox to the
right. Chr$(12) is the default form feed character string.
- BG Image
Opens a dialog from which to select the background image
- File Name
Opens a dialog from which to select the file containing text to be displayed
- Margins
sets the top/left/right/bottom margins, in inches
Header
Content of the header and footer settings sections are identical, so on
Footer
Content of the footer and header sections are identical. See the headers description
above for a description of the foot settings options.
Preview Context Menu
The following context menus options are available by right-clicking over the preview area.
- Display First Page
- displays page one
- Display Last Page
- displays the largest available page
- Prior Page
- displays the page prior to the currently displayed page
- Next Page
- displays the page after to the currently displayed page
- Copy Page image
- copies an image of the current page to the clipboard
- Save Page Image as BMP
- saves a copy of the current page, in BMP format, to the user-specified file name
- Save Page Image as JPG
- saves a copy of the current page, in JPG format, to the user-specified file name
- Copy Page Text
- puts a copy of all text from the current page onto the clipboard
- Copy Document Text
- puts a copy of all document text onto the clipboard
- Sort Ascending
- sorts document in ascending order
- Sort Descending
- sorts document in descending order
- Natural Order
- displays text in the order found in the document
- Left Justify
- trims all spaces off all lines in the document
- Open File
- opens a dialog from which to select the text to be displayed
- Save As
- saves the document text, as displayed, to a user-specified file
- Open Saved As File
- using the default external client, opens the most recently saved file
Keyboard Shortcuts
The following key combinations are available to the user to access gbPrintPreview features:
- F1 - Help
- F9 - Search dialog
- Ctrl+D - Select printer dialog
- Ctrl+F - Toggle footer display
- Ctrl+G - Toggle gray scale display of image
- Ctrl+H - Toggle header display
- Ctrl+I - Display popup dialog showing various print settings
- Ctrl+K - Display prior page
- Ctrl+L - Toggle display of line numbers
- Ctrl+M - Toggle display of margins
- Ctrl+N - Display next page
- Ctrl+P - Use Zoom Factor "Page"
- Ctrl+R - Print range of pages
- Ctrl+S - Display Settings dialog
- Ctrl+T - Toggle display of 3 different sample texts
- Ctrl+W - Use Zoom Factor 100%
- Ctrl+X - Close Print Preview dialog
- Ctrl+Z - Cycle through zoom factor settings
- Home - Display first page
- End - Display last page
- Prior - Display prior page
- Next - Display next page
Other Comments
Comments and suggestions are welcome!