Export pdf files in the PowerBuilder Data window

Source: Internet
Author: User
Tags sybase acrobat distiller
PowerBuilder 9.0 datawindow exporting PDF files
Export datawindow to a PDF file. For this reason, I have tried several versions of PowerBuilder (PowerBuilder 9.0, PowerBuilder 10.0), but none of them have been successful. I always thought it was a PB bug. Today I found a lot of information on the Internet and finally got it done. The original installation of gs705w32.exe and Acrobat virtual printer. PB exporting PDF files in this way is too unprofessional.

1. Download and install gs705w32.exe
Http://www.processlist.com/info/gs705w32.html
2. Install gs705w32.exe. The default installation path is C:/Gs.
3. Install a virtual printer
1) directly on the Control Panel> printer and fax> Add a printer. The default port is LPT1;
2) The printer driver comes with powerbuilder9.0, which is located in the installation folder of powerbuilder9.0,
Choose install from disk> X: \ Program Files \ Sybase \ shared \ PowerBuilder \ drivers, select adist5.inf, and read the following five drivers:
Acrobat Distiller,
Acrobat Distiller CS,
Acrobat Distiller CT,
Acrobat Distiller J,
Acrobat Distiller K
Select the first Acrobat Distiller
4. Use SaveAs () in the code to output the pdf file: int li_rc
String ls_title = "output pdf file"
String ls_PathName, ls_FileName

// Select the output file
Li_rc = getfilesavename (ls_title, ls_pathname, ls_filename, "pdf", "pdf file (*. pdf), *. pdf ")

If (li_rc = 1) then
// Use the distill method to output a PDF file
Dw_1.object.data={export.}.method = distill!

// Select a printer
Dw_1.object.data1_1_printer = "Acrobat Distiller"
Dw_1.object.data+{export.}.distill.custompostscript = "Yes"

// Output a pdf file
If (dw_1.SaveAs (ls_PathName, PDF !, True) = 1) then
Messagebox (ls_title, "saved successfully! ")
Else
Messagebox (ls_title, "failed to save! ", StopSign !)
End if
End if

The above programs are successfully debugged under PowerBuilder 9.01 Build 7096.

In addition, you can edit the. BAT file in X: \ Program Files \ Sybase \ Shared \ PowerBuilder \ drivers and write:
Rundll32.exe printui. dll, PrintUIEntry/if/f. \ ADIST5.INF/r "LPT1:"/B "Acrobat Distiller"/m "Acrobat Distiller"
Run it to add a virtual printer.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.