DOCUMENT:Q177740 08-DEC-1997 [vbwin] TITLE :BUG: Scale Method Results in a Number of Blank Pages Printed PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0 OPER/SYS:WINDOWS KEYWORDS:VBKBPrinting ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 5.0 --------------------------------------------------------------------- SYMPTOMS ======== The Scale method of the Printer object prints a number of blank pages when the Scale values are set so that the first Y-coordinate value is greater than the second Y-coordinate value. RESOLUTION ========== To work around this bug, set Y-coordinate values in the Scale method so the first Y-coordinate is less than the second Y-coordinate. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION ================ This section shows you how to reproduce this bug. NOTE: Set your default printer to print to a file if you want to reproduce this bug. Sending the output to a printer may result in many blank pages. Steps to Reproduce Behavior --------------------------- 1. Start a new Standard EXE project in Visual Basic. Form1 is created by default. 2. Add two CommandButtons to Form1. 3. Copy the following code to the Code window of Form1: Option Explicit Dim intCounter As Integer Private Sub Form_Load() Command1.Caption = "Demonstrate the Problem" Command2.Caption = "Demonstrate the Expected Behavior" End Sub Private Sub Command1_Click() 'This button demonstrates the problem. Printer.Scale (0, 250)-(140, 0) 'Y-Coordinate is descending Printer.Print " " For intCounter = 1 To 100 Printer.Print "Item #" & intCounter Next intCounter MsgBox "# Pages : " & Printer.Page Printer.EndDoc End Sub Private Sub Command2_Click() 'This button demonstrates the expected behavior Printer.Scale (0, 0)-(140, 250) 'Y-Coordinate is ascending Printer.Print " " For intCounter = 1 To 100 Printer.Print "Item #" & intCounter Next intCounter MsgBox "# Pages : " & Printer.Page Printer.EndDoc End Sub 4. Press the F5 key to run the program. Click Expected Behavior to determine how many pages are printed. Click Bug Behavior and note that the number of pages printed exceed that of the Expected Behavior button. Additional query words: print job blank pages (c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Arsenio Locsin, Microsoft Corporation ====================================================================== Keywords : VBKBPrinting Version : WINDOWS:5.0 Platform : WINDOWS Issue type : kbbug ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1997.