Web Forms Print Manager

In Web Forms applications, output from supported PowerScript print functions is published as PDF files on the server side. These PDF files are visible in the client-side Web browser through links in the Web Forms Print Manager, and they can be printed on the client side.

The following system print functions are supported in .NET Web Forms applications: Print, PrintCancel, PrintClose, PrintDefineFontDefine, PrintLine, PrintOpen, PrintOval, PrintPage, PrintRect, PrintRoundRect, PrintSetSpacing, PrintText, PrintWidth, PrintX, PrintY. PrintSetFont is also supported, but its return value is not the same as in a standard PowerBuilder application.

File operation output

You can use the DataWindow control’s Print method to print a DataWindow object to a PDF file. Application users can open the PDF file in a separate browser instance by selecting the print result in the Print Manager. They can then print the PDF file using the File > Print menu of the browser.

You can also use the SaveAs method to print DataWindows and their data as PDF or XSL files. These files are not visible in the Print Manager. However, you can call the DownloadFile function (in a conditional compilation block) to download these files, or application users can download them from the server using the Web Forms File Manager and then print them from a local browser or Adobe Reader application.

See DownloadFile. For information on the File Manager, see Web Forms File Manager.

Print Manager icon

When supported print functions are used to print text in a Web Forms application, a printer icon appears in the right-top corner of the main browser window.

The application user can click the icon to open the Web Forms application Print Manager. The Print Manager lets the application user open a window to view the printed output as PDF files.

This picture shows the Print Manager with hyperlinks to printed files:

If you do not want the Print Manager icon to appear on a specific window in your application, you can set the HasPrintManager property for that window to false. The Print Manager icon automatically disappears on browser refresh after all the printed files are removed from the Print Manager window.

You can also code an application event to open the Print Manager by calling the OpenPrintManager function.

See HasPrintManagerand OpenPrintManager.

Where printed output is saved

Printed output is saved to files in the applicationName_root\Print\Session\SessionID directory under the virtual root for IIS Web sites, or in the applicationName_root\Print\User\UserName directory if the current application user is logged in with a permanent user account profile. The applicationName_root\Print\Session and the applicationName_root\Print\User directories are created when you deploy your application. The SessionID or UserName directory is created by the ASP.NET runtime engine after a PrintOpen call.

The SessionID directory created under the Print\Session directory uses the same session ID number as the subdirectory created under the applicationName_root\File\Session directory when the user saves a DataWindow as a PDF or writes to a file from the current application session, or when the PBWebFileProcessMode global property has been set to Copy mode. The actual SessionID directory name is a long 24-character string with letters and numbers such as cdxgel554rkxxsbn1221uh55. Unless the user creating the printed files has logged in as a permanent user, the SessionID directories are deleted when the Web Forms session is ended.