Creating PDF file in PowerBuilder

与世无争的帅哥 提交于 2019-12-24 01:24:44

问题


I am new to PowerBuilder. I got an assignment to create a PDF file using PowerBuilder. How can I do that?


回答1:


as suggested by Alberto Megia, download PDF creator, but dont use SAVE AS. After you install pdf creator it will install a printer, use that printer to save the datawindow with the print function.

after call print function, you will see a "Save as" dialog.

If you use "saveas" function, the pdf will not have the format that the datawindow shows.




回答2:


Our organization used to use Ghostscript, but has instead moved to Amyuni.




回答3:


What version of PowerBuilder are you using? The most recent versions have PDF capability built in (using Ghostscript).




回答4:


Install Ghostscript. Get PDFCreator for free there and install it. Then you can save as PDF any datawindow or datastore with the statement:

dw_1.saveAs(path_where_to_save_with_name_of_file.pdf, PDF!, true)

Third parameter is for override if the file exists with that name. I hope it works for you. Regards, Alberto




回答5:


We just use Ghostscript. I wrote Ghostscript setup instructions earlier. We also print Word documents we've filled in to PDF from our app by printing them to 'Sybase DataWindow PS' printer then running Ghostscript to make the PDF.




回答6:


Good Question - There really isn't an easy way other than finding a third party tool. I've tried the prior method mentioned and it does work but not without headaches and you are left with deployment headaches, deploying ghost script and having to make sure Post Script drivers are on the client.

I ended up trying many PDF converters, both free and paid, the one that worked most seamlessly was one that installed as a "printer" such as if you have Adobe installed on the PC, but you need to dynamically verify existence of the printer via RegistryGet and if it doesn't exist ask user to install or install it dynamically via code, and registry entries (not fun).

After several headaches mostly related to deployment issues I ended up going with a server solution, but it requires having a server that you can have a process (distiller) running that grabs post script files and distills them to PDF. I used a response window with progress bar, the PB app printed post script file to server location upon which the distiller grabs and converts. My PB app polls the server until it finds the PDF, or the user cancels whichever comes first. With a good distiller the process is fast (< 5 seconds) which was acceptable to our users.

Upon existence of the PDF, we'd attach it to an email and send via Oracle (mapi). This solution limits the requirements on client to post script driver which in most corporate environments is there, but you need to check it via Registry. Maybe there is a better solution out there since I did this last, around 2008.

fyi- I usually don't make vendor recommendations but will in this case because there was one that stood out in ease of use and quality, it was called PDFCreator which installs as a windows printer. It looks to be open-source right now but I recall that we would have had to pay to use it in corporate environment.

Good Luck.




回答7:


Use the tutorial How to use PowerBuilder to create PDF file?.



来源:https://stackoverflow.com/questions/3888359/creating-pdf-file-in-powerbuilder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!