1//WinPrint2_API.pkg 2 3Use DLL.pkg 4 5External_Function WP_IsPrinterValid "IsPrinterValid" WinPrint.dll ; 6Returns Boolean // True if the the current printer is a valid one. False, otherwise. 7 8External_Function WP_ArePrintersInstalled "ArePrintersInstalled" WinPrint.dll ; // determines whether at least one printer is installed 9Returns Boolean // True, if a printer is installed, False if it is not. 10 11External_Function WP_ExecutePrinterSetupDialog "ExecutePrinterSetupDialog" WinPrint.dll ; // displays the "printer setup" dialog 12 Handle hWndParent; // window handle of the parent window 13Returns Boolean // True if the OK button pressed; False, otherwise. 14 15External_Function WP_ExecutePrintDialog "ExecutePrintDialog" WinPrint.dll ; // displays the "Print" dialog 16 Handle hWndParent; // window handle of the parent window 17Returns Boolean // True if the OK button pressed; False, otherwise. 18 19External_Function WP_GetCurrentDevice "GetCurrentDevice" WinPrint.dll ; // retrieves the name of the current printer device 20 Address aDevice ; // address of the string (255 chars) that will hold the device name upon return 21Returns Boolean // True, if success; False if error occurred 22 23External_Function WP_GetPrintDialogFlags "GetPrintDialogFlags" WinPrint.dll ; // retrieves the current print options 24Returns UInteger // array of flags representing print-related options that are currently set 25 26External_Function WP_GetUserDefinedPapersize "GetUserDefinedPapersize" WinPrint.dll ; // gets the size of user-defined paper 27Returns UInteger // // hi-word=length; lo-word=width 28 29External_Function WP_IsPrintDialogFlagSet "IsPrintDialogFlagSet" WinPrint.dll ; // determines whether a specific print-flag is set 30 UInteger iFlag ; // the printer flag 31Returns Boolean // True, if the flag is set; False, if it isn't 32 33External_Function WP_SelectPrinter "SelectPrinter" WinPrint.dll ; // selects a printer programatically 34 String sDevice; // the name of the printer 35Returns Boolean // True, if success; False, if error (such as an invalid printer name) 36 37External_Function WP_SetFirstPagePaperSource "SetFirstPagePaperSource" WinPrint.dll ; 38 Integer iBin ; // the bim constant 39Returns Boolean // True if success, false if error 40 41External_Function WP_SetNumberOfPrintCopies "SetNumberOfPrintCopies" WinPrint.dll ; // sets the number of copies to print 42 UInteger iNumCopies; // number of copies to make 43Returns Boolean // Always True 44 45External_Function WP_SetSpecificPrintDialogFlag "SetSpecificPrintDialogFlag" WinPrint.dll; // Sets/unsets one printer flag 46 UInteger fFlag; // printer flag 47Returns Boolean // True, if success; False if error occurred 48 49External_Function WP_SetPrintDialogFlags "SetPrintDialogFlags" WinPrint.dll; // Sets/unsets all printer flags in one call 50 UInteger fFlags; // printer flags 51Returns Boolean // True, if success; False if error occurred 52 53External_Function WP_SetUserDefinedPapersize "SetUserDefinedPapersize" WinPrint.dll ; // sets the size of user-defined paper 54 UInteger iPaperSize ; // hi-word=length; lo-word=width 55Returns Boolean; // True, if success; False if error occurred 56 57External_Function WP_SetFontStyle "SetFontStyle" WinPrint.dll ; // sets multiple font attributes 58 Integer iStyles ; // series of flags 59Returns Boolean // always True 60 61External_Function WP_SetFontBold "SetFontBold" WinPrint.dll ; // toggles the bold attribute of the current font 62 Boolean bBold ; // True to switch bold attribute on; False to switch it off 63Returns Boolean // always True 64 65External_Function WP_SetFontItalic "SetFontItalic" WinPrint.dll ; // toggles the italic attribute of the current font 66 Boolean bItalic ; // True to switch italic attribute on; False to switch it off 67Returns Boolean // always True 68 69External_Function WP_SetFontUnderline "SetFontUnderline" WinPrint.dll ; // toggles the underline attribute of the current font 70 Boolean bUnderline ; // True to switch underline attribute on; False to switch it off 71Returns Boolean // always True 72 73External_Function WP_SetFontStrikeout "SetFontStrikeout" WinPrint.dll ; // toggles the strikeout attribute of the current font 74 Boolean bStrikeout ; // True to switch strikeout attribute on; False to switch it off 75Returns Boolean // always True 76 77External_Function WP_SetFontColor "SetFontColor" WinPrint.dll ; // sets the color of the current font 78 Integer iColor ; // color of the font 79Returns Boolean // always True 80 81External_Function WP_SetFontHeight "SetFontHeight" WinPrint.dll ; // sets the height of the font 82 UInteger iHeight ; // height of the font in points (multiplied by 100. Eg 12.5 point should be sent as 1250) 83Returns Boolean // always True 84 85External_Function WP_SetFontName "SetFontName" WinPrint.dll ; // Sets the name of the font to use 86 String sFontName ; // name of the font to use 87Returns Boolean // always True 88 89External_Function WP_DrawBitmap "DrawBitmap" WinPrint.dll ; // Draws a bitmap (BMP, JPG) 90 String sBitmap; // Name of the bitmap 91 Integer iLeft; // distance from left edge to draw bitmap 92 Integer iTop; // distance from top edge to draw bitmap 93 Integer iWidth; // width of the bitmap 94 Integer iHeight; // height of the bitmap 95 Boolean bUpdateCurrentPosition; // after drawing, should the current position be updated? 96Returns Boolean // True, if OK; False, if an error occurred. 97 98External_Function WP_DrawEllipse "DrawEllipse" WinPrint.dll ; // draws an elipse within a bounding rectangle 99 Integer iLeft; // distance from left edge to draw the ellipse 100 Integer iTop; // distance from top edge to draw the ellipse 101 Integer iWidth; // width of the bounding rectangle 102 Integer iHeight; // height of the bounding rectangle 103 Integer iBorderColor; // color of the ellipse's edge 104 Integer iFillColor; // internal color of the ellipse 105 Boolean bFill; // should the ellipse be filled? (False=transparent) 106 UInteger iThickness; // thickness of the elipse 107 Boolean bUpdateCurrentPosition; // after drawing, should the current position be updated? 108 Boolean bWrap; // Should the ellipse be drawn on future soft-page breaks? 109Returns Boolean // True, if OK; False, if an error occurred. 110 111External_Function WP_DrawLine "DrawLine" WinPrint.dll ; // draws a line from the current position 112 Integer iLeft; // distance from left edge to draw the line 113 Integer iTop; // distance from top edge to draw the line 114 Integer iLength; // length of the line 115 Boolean bHorizontal; // draw horizontal? (False=vertical) 116 Integer iColor; // color of the line 117 UInteger iThickness; // thickness of the line 118 Boolean bUpdateCurrentPosition; // after drawing, should the current position be updated? 119Returns Boolean // True, if OK; False, if an error occurred. 120 121External_Function WP_DrawRectangle "DrawRectangle" WinPrint.dll ; // draws a rectangle 122 Integer iLeft; // distance from left edge to draw the rectangle 123 Integer iTop; // distance from top edge to draw the rectangle 124 Integer iWidth; // width of the rectangle 125 Integer iHeight; // height of the rectangle 126 Integer iBorderColor; // color of the rectangle's border 127 Integer iFillColor; // internal color of the rectangle 128 Boolean bFill; // should the rectangle be filled? (False=transparent) 129 UInteger iThickness; // thickness of the rectangle's border 130 Boolean bUpdateCurrentPosition; // after drawing, should the current position be updated? 131 Boolean bWrap; // Should the rectangle be drawn on future soft-page breaks? 132Returns Boolean // True, if OK; False, if an error occurred. 133 134External_Function WP_DrawXYLine "DrawXYLine" WinPrint.dll ; // draws a line between two points 135 Integer iLeftStart; // distance from left edge to draw from 136 Integer iTopStart; // distance from top edge to draw from 137 Integer iLeftEnd; // distance from left edge to draw to 138 Integer iTopEnd; // distance from top edge to draw to 139 Integer iColor; // color of the line 140 UInteger iThickness; // thickness of the line 141 Boolean bUpdateCurrentPosition; // after drawing, should the current position be updated? 142 Boolean bWrap; // Should the line be drawn on future soft-page breaks? 143Returns Boolean // True, if OK; False, if an error occurred. 144 145External_Function WP_SetAbsoluteMargins "SetAbsoluteMargins" WinPrint.dll ; // modifies the top/bottom non-printable margin 146 UInteger iTop; // the top margin offset 147 UInteger iBottom; // the bottom margin offset 148 Boolean bAllPages; // should all pages be affected? True=AllPages; False=first page only 149Returns Boolean // always True 150 151External_Function WP_SetMargins "SetMargins" WinPrint.dll ; // Sets the user-margins 152 UInteger iLeft; // the left margin 153 UInteger iTop; // the top margin 154 UInteger iRight; // the right margin 155 UInteger iBottom; // the bottom margin 156Returns Boolean // always True 157 158External_Function WP_CreateDiagram "CreateDiagram" WinPrint.dll ; // Creates a new diagram 159 UInteger eType; // type of diagram (Bar, Line, Pie) 160 UInteger eEffect; // how it is drawn (2d or 3d, etc) 161 UInteger iWidth; // width of the diagram 162 UInteger iHeight; // height of the diagram 163 Boolean bDrawXyAxis; // draw the xy-axis (for bar charts only)? 164Returns Handle // unique id for the diagram used in other diagram funtions 165 166External_Function WP_AddDiagramEntry "AddDiagramEntry" WinPrint.dll ; // Adds an item into a diagram 167 Handle hDiagram; // diagram handle returned by CreateDiagram() 168 String sValueDescription; // description of the item 169 String sValue; // value of the item 170 Integer iBorderColor; // color of the item's border 171 Integer iFillColor; // color of the item's interior 172 Boolean bFilled; // should the item be drawn filled (with iFillColor), or transparent? 173 UInteger iNumDecimals; // Number of decimals in the sValue argument 174 UInteger eValueOrPercent; // How the value should be displayed (as value or percentage, etc) 175 Boolean bExploded; // should the value be "pulled out" (pie charts only) 176Returns Boolean // True, if success; False, if error 177 178External_Function WP_DrawDiagram "DrawDiagram" WinPrint.dll ; // draws a diagram 179 Handle hDiagram; // diagram handle returned by CreateDiagram() 180 UInteger iLeft; // x-coordinate to draw the diagram 181 UInteger iTop; // y-coordinate to draw the diagram 182 Boolean bUpdateCurrentPosition; // after drawing, should the current position be updated? 183Returns Boolean // True, if success; False, if error 184 185External_Function WP_LockDiagram "LockDiagram" WinPrint.dll ; // Locks a diagram so that no more entries can be added 186 Handle hDiagram; // diagram handle returned by CreateDiagram() 187Returns Boolean // True, if success; False, if error 188 189External_Function WP_SetDiagramCaption "SetDiagramCaption" WinPrint.dll ; // Sets the caption of a diagram 190 Handle hDiagram; // diagram handle returned by CreateDiagram() 191 String sCaption; // the diagram's caption 192Returns Boolean // True, if success; False, if error 193 194External_Function WP_SetDiagramXText "SetDiagramXText" WinPrint.dll ; // Sets the horizontal label of a diagram 195 Handle hDiagram; // diagram handle returned by CreateDiagram() 196 String sText; // the diagram's horizonal label 197Returns Boolean // True, if success; False, if error 198 199External_Function WP_SetDiagramYText "SetDiagramYText" WinPrint.dll ; // Sets the vertical label of a diagram 200 Handle hDiagram; // diagram handle returned by CreateDiagram() 201 String sText; // the diagram's vertical label 202 Boolean bVerticalText; // should the text be drawn vertically (False=horizontally) 203Returns Boolean // True, if success; False, if error 204 205External_Function WP_BeginHeader "BeginHeader" WinPrint.dll ; // creates a new header 206 UInteger iHeaderType; // the type of header 207 UInteger iSubHeaderNum; // for subheaders, then number (1-0) 208Returns Boolean // always True 209 210External_Function WP_EndHeader "EndHeader" WinPrint.dll ; // declares the end of the current header 211Returns Boolean // always True 212 213External_Function WP_SetExtraLineCheck "SetExtraLineCheck" WinPrint.dll ; // forces a soft page break if header plus number of lines don't fit on page 214 UInteger iNumLines; // number of lines in addition to header required before forcing a soft page-break 215Returns Boolean; // always True 216 217External_Function WP_SetHeaderFrame "SetHeaderFrame" WinPrint.dll ; // sets the style, color and frame of a header 218 UInteger eFrame; // style of frame (margin-to-margin, etc) 219 Integer iColor; // color of the frame's edge 220 UInteger iThickness; // thickness of the frame 221 Integer iFillCol; // the internal color of the frame (only used if bBilled=True) 222 Boolean bFilled; // True, if the frame should be filled with the iFillColor (False=Transparent) 223Returns Boolean // Always True 224 225External_Function WP_SetHeaderMargin "SetHeaderMargin" WinPrint.dll ; // Sets a margin of space on the inside and outside of the current header 226 UInteger eType; // Specifies which margin areas is being set. 227 Integer iSize; // Size of the margin setting in the current report metrics 228Returns Boolean // False if document is not started 229 230External_Function WP_SetHeaderPlacement "SetHeaderPlacement" WinPrint.dll ; // placement (left, center or right) of the header 231 UInteger ePlacement; // placed left, center or right 232Returns Boolean //always True 233 234External_Function WP_SetHeaderWrap "SetHeaderWrap" WinPrint.dll ; // determines whether the current header is drawn on soft page-breaks 235 Boolean bWrap; // True, to wrap onto following pages; False, for current page only 236Returns Boolean // always True 237 238External_Function WP_WriteHeader "WriteHeader" WinPrint.dll ; // writes a header to the current page 239 UInteger eHeaderType; // type of header 240 UInteger iSubHeaderNum; // for subheaders, the number (1-9) 241Returns Boolean // True, if success; False, if error 242 243External_Function WP_RGBToDFPrintColor "RGBToDFPrintColor" WinPrint.dll ; // converts R, G, and B values into a composite color that WinPrint expects 244 UInteger iRed; // red component (1-255) 245 UInteger iGreen; // green component (1-255) 246 UInteger iBlue; // blue component (1-255) 247Returns Integer // composite color 248 249External_Function WP_GetMetrics "GetMetrics" WinPrint.dll ; // gets the current unit of measurement 250Returns UInteger // unit of measurement (Inch or CM) 251 252External_Function WP_SetMetrics "SetMetrics" WinPrint.dll ; // sets the unit of measurement 253 UInteger eMetrics; // Inch or CM 254Returns Boolean // always True 255 256External_Function WP_ClearDocument "ClearDocument" WinPrint.dll ; // clears the resources of the document from memory 257Returns Boolean // always True 258 259External_Function WP_NewDocument "NewDocument" WinPrint.dll ; // starts a new document, but preserves the printer settings 260 Boolean bAutoPreview ; // Should the Previewer be displayed immediately 261Returns Boolean // True, if success; False, if an error occurred 262 263External_Function WP_EndDocument "EndDocument" WinPrint.dll ; // Indicates that the document is finished 264Returns Boolean // always True 265 266External_Function WP_ClearPrinter "ClearPrinter" WinPrint.dll ; // clears all printer and document resources 267Returns Boolean // True, if success; False, if an error occurred 268 269External_Function WP_ConfirmLines "ConfirmLines" WinPrint.dll ; // ensures that a specified number of lines will fit on the page; if not, a soft page-break is performed automatically 270 UInteger iNumLines; // number of lines that must fit on the page 271Returns Boolean // True, if success; False, if an error occurred 272 273External_Function WP_CreatePage "CreatePage" WinPrint.dll ; // creates a new page of specified columns 274 UInteger iNumColumns; // number of columns (zero= no columns) 275Returns UInteger; // page number that was created 276 277External_Function WP_PreviewDocument "PreviewDocument" WinPrint.dll ; // previews the current document 278 Boolean bPrintDialog; // Determines whether the Print Dialog (range, etc) is displayed when the "print" button is clicked in the preview window. 279 Boolean bPrintSetup; // Determines whether the Print Setup button is enabled (allows to change orientation, etc) 280 Boolean bPrint; // Determines whether the Print button is enabled 281Returns Handle // non-zero = hViewerProcess; zero= error 282 283External_Function WP_ClosePreview "ClosePreview" WinPrint.dll ; // closes the preview window 284Returns Boolean // True, if closed; False, if an error occurred (such as it not being already open) 285 286External_Function WP_PrintDocument "PrintDocument" WinPrint.dll ; // prints the current document 287 Handle hWndParent; // window handle of object to use for any modal output 288Returns Boolean // True, if success; False, if an error occurred 289 290External_Function WP_SetAlign "SetAlign" WinPrint.dll ; // align future text 291 UInteger eAlign; // left, center or right 292Returns Boolean // always True 293 294External_Function WP_WriteText "WriteText" WinPrint.dll ; // write text to the current position or column 295 String sText; // the text to write 296 Boolean bNewLineAfterPrint; // should a "CR" be written after the text 297 UInteger iColumnNum; // number of the column to write to (zero=no column, use current position) 298 Integer iNumDecimals; // number of decimals in the text (-1 means sText is a string) 299 UInteger iWidth; // width of text before truncating 300Returns Boolean // True, if success; False, if an error occurred 301 302External_Function WP_WriteTextAtPosition "WriteTextAtPosition" WinPrint.dll ; // writes text to a specific position 303 String sText; // the text to write 304 Boolean bNewLineAfterPrint; // should a "CR" be written after the text 305 UInteger iPosition; // horizontal position to write the text 306 Integer iNumDecimals; // number of decimals in the text (-1 means sText is a string) 307 UInteger iWidth; // width of text before truncating 308Returns Boolean // True, if success; False, if an error occurred 309 310External_Function WP_SetProgressCaption "SetProgressCaption" WinPrint.dll ; 311 String sProgressCaption ; 312Returns Boolean 313 314External_Function WP_SetReportTitle "SetReportTitle" WinPrint.dll ; 315 String sCaption ; 316Returns Boolean 317 318External_Function WP_ViewerWantsToClose "ViewerWantsToClose" WinPrint.dll ; 319Returns Integer 320 321External_Function WP_DisplayMessageBox "DisplayMessageBox" WinPrint.dll ; 322 String sCaption String sText ; 323Returns Integer 324 325External_Function WP_GetViewerWindow "GetViewerWindow" Winprint.dll ; 326Returns Handle 327 328External_Function WP_GetDocumentStatus "GetDocumentStatus" Winprint.dll ; 329Returns Integer // returns dsNotStarted, dsStarted, or dsFinished 330