Data window PDF output (The result of a single defeat was obtained in Nanshan District, Shenzhen in January 14, 2004) The PDF (Portable Document Format) format is an electronic file format developed by adoble. This file format has nothing to do with the operating system platform. That is to say, PDF files are common in either Widnows, UNIX, or Apple's Mac OS Operating System. This feature makes it an ideal document format for electronic document distribution and digital information dissemination on the Internet. More and more books, product descriptions, company reports, online materials, and emails are using PDF files. Pb9.0 adds support for saving the data window as a PDF document, and provides two methods to save the data window or data as a report in pdf format. The default extraction method is distill, which can save all types of data window objects. The data window can also save the PDF format using an XSL format object (XSL-FO. 1. distill Extraction Method The distill method is the default method for generating PDF files in a data window. In this way, you do not need to change the properties of the data window object, you can directly select the file/save rows as menu item in the data window object canvas. In the pop-up "Save as" dialog box, select the Save type as PDF to save. If you use the Save As () function in the script, set the Save type to PDF, or save the data window as a PDF file. For example: Int li_ret String ls_docname, ls_named Integer li_value Li_value = getfilesavename ("select Save file", + ls_docname, ls_named, "pdf file", + "pdf file (*. pdf), *. pdf ") If li_value <> 1 then return Li_ret = dw_1.saveas (ls_docname, PDF !, True) If li_ret = 1 then MessageBox ('prompt info', 'saved as a PDF file! '+ '~ R ~ N file: '+ ls_docname) Else MessageBox ('prompt info', 'failed to save as a PDF file! ') End if Shows the PDF file generated by the data window object: The distill method currently does not support data window objects of the OLE and richtext types. PB uses a postscript printing driver designed for converting to PDF output for extraction. to customize postscript settings when generating a PDF document, you can select different postscript printing drivers. The method is as follows: 1. Data window drawing board 1) Open a data window object 2) Select the data export tab in the object property view of the data window, select PDF from the format to configure drop-down list, and select distill from the method drop-down list !, Select the distill postscript M postscript check box. As shown in: 3) Select the print specifications tab and enter the specified printer name in the printer Name text box. 4) Save the data window object, select the file/save rows as menu item, in the pop-up "Save as" dialog box, select the Save type as PDF, and enter the file name in the file name text box. 2. Use the following method in the script: Int li_ret Dw_1.object.data={export.}.method = distill! Dw_1.object.data?#printer =// Prntsrvr/pr-6 Dw_1.object.data+{export.}.distill.custompostscript = "yes" Li_ret = dw_1.saveas ("M. pdf", PDF !, True) 2. Saving PDF documents using XSL-FO Based on the ability to save datawindow data in XML format, Pb can also save the data and representation of the data window by generating an XSL format object (XSL-FO) to PDF document. XSL-FO is the Extensible style sheet language (Extensible Stylesheet Language for Formatting Objects) for Formatting Objects. To generate a PDF document using a XSL-FO, you must modify the properties of the data window objects. 1. Data window drawing board 1) Open the data window object. 2) Select the data export tab in the object property view of the data window, select PDF from the format to configure drop-down list, and select export fop from the method drop-down list !. If you want to send a PDF file to the printer at the same time, select the "distill print using into fop" check box. As shown in: 3) Save the data window object, select the file/save rows as menu item, in the pop-up "Save as" dialog box, select the Save type as PDF, and enter the file name in the file name text box. 2. Use the following method in the script: Int li_ret String ls_docname, ls_named Integer li_value Li_value = getfilesavename ("select Save file ",& + Ls_docname, ls_named, "pdf file ",& + "Pdf file (*. pdf), *. pdf ") If li_value <> 1 then return // Customize XSL-FO Mode Dw_1.modify ("export. pdf. method = effecfop! ") Dw_1.modify ("export. pdf. Export fop. Print = 'Yes '") Li_ret = dw_1.saveas (ls_docname, PDF !, True) If li_ret = 1 then MessageBox ('prompt info', 'saved as a PDF file! '+ & '~ R ~ N file: '+ ls_docname) Else MessageBox ('prompt info', 'failed to save as a PDF file! ') End if The XSL-FO method currently does not support Ole, richtext, graph, and composite data window objects. |