New Features
SftPrintPreview/DLL 2.0 is virtually 100% upward compatible from version 1.0. The following major enhancements have been made available with SftPrintPreview/DLL 2.0:
- New %output% and %printer% variables for headers/footers.
- An application can now provide custom string substitution variables for the headers/footers (SFTPRINTPREVIEW_CONTROL, lpCustomVars and SFTPRINTPREVIEW_CUSTOMVAR).
- Output can now also be rendered into a Gdiplus::Graphics object, in addition to an output device context (HDC).
- Zooming in/out now allows the clicked page position to remain at the same position in the resulting display (see SFTPRINTPREVIEW_CONTROL, fCenterOnClick).
- Zooming in/out now supports new zoom styles that allow the page to be scrolled further off screen (see SFTPRINTPREVIEW_CONTROL, iZoomStyle).
- A single page preview now allows the page to be dragged to be repositioned on screen (see SFTPRINTPREVIEW_CONTROL, fDragPage).
- The default number of pages to print can now be specified for the Print Dialog using SFTPRINTPREVIEW_CONTROL, cntLimitPages.
- The entire output can now be cached for maximum performance, at the expense of additional system resources use (SFTPRINTPREVIEW_CONTROL, fCachePages).
- A new minimum gap between header/footer and the page body can be defined, insuring that they do not overlap (SFTPRINTPREVIEW_CONTROL, fltMinHeaderGap, fltMinFooterGap).
- If printing fails using the Print function, additional error information is available by retrieving the SFTPRINTPREVIEW_CONTROL structure (fPrintUserAbort, fPrintAppShutDown, fPrintPageOutOfRange, dwdPrintLastError, szPrintLastFunc).
- The color used for header and footer lines can be defined using SFTPRINTPREVIEW_COLORS, colorHeaderLine and colorFooterLine.
- The color used for header and footer text can be defined using SFTPRINTPREVIEW_COLORS, colorHeaderText and colorFooterText.
- The Zoom function now allows the center point to be offset vertically and horizontally (see SFTPRINTPREVIEW_ZOOM).
- The ZoomIn function now allows the center point to be offset vertically and horizontally (see SFTPRINTPREVIEW_ZOOMIN).
- When previewing, margins and gutter margin may be shown shaded using defined colors (see SFTPRINTPREVIEW_CONTROL, fShowAreas).
- The new PrintSetupExternal function is identical to the PrintSetup function, but doesn't require a SftPrintPreview control to be active and returns the defined printer in a SFTPRINTPREVIEW_PRINTERRESULT structure. This allows an application to manipulate the current/selected printer before the first SftPrintPreview control is created.
- The IsDefaultPrinterExternal function can be used to determine whether the printer settings defined by a SFTPRINTPREVIEW_PRINTERRESULT structure define the current printer. This allows an application to manipulate the current/selected printer before the first SftPrintPreview control is created.
- The CheckMarginsPrintable and CheckMarginsPrintableExternal functions can be used to determine whether specified margins are within the printer's printable area.
- The GetDefaultPrinter function returns the default printer as defined by Windows.
- The GetOrientation function can be used to retrieve the current printer's page orientation.
- The SFTPRINTPREVIEW_DRAWINFO structure now also contains the window handle of the SftPrintPreview control.
- New informational SFTPRINTPREVIEW_PRINT_PREPAREPAGE function in the SFTPRINTPREVIEW_DRAWINFO structure used as a parameter to the SFTPRINTPREVIEW_DRAWINFOPROC function.
- The "Preparing to print" dialog shown when the Print function is used, can now be suppressed SFTPRINTPREVIEW_CONTROL, fWantCancelDialog).
- The messages shown when the Print function fails, can now be suppressed (SFTPRINTPREVIEW_CONTROL structure, fShowErrorMessage).
- The built-in Page Setup dialog now supports a minimum gap below the header and above the footer, to eliminate headers and footers overlaying the page body.
- The built-in Page Setup dialog now supports color definitions for the lines below/above the header and footer and for the header and footer text.
- The built-in Page Setup dialog now allows margins and gutter margins to appear shaded when previewing output.
- Digitally signed DLLs.
- DynamicHelp and help integration with Visual Studio 2008 (in addition to all others which were already supported in previous releases).
- More sample code in documentation.