1. Roland Smith
  2. PowerBuilder
  3. Wednesday, 6 December 2017 15:55 PM UTC

In our app we have a DataWindow report with a background image that is saved to PDF. A customer reports their C drive being filled up while running the process that creates the PDF. For this customer, the report has about 850 pages. The process saves one PDF of the entire report and then repeatedly filters the DataWindow to a single page and saves each one to PDF. It ends up creating one 850 page file and 850 one page files. The files are saved to the database and deleted as they are created so there should only be one finished file on disk at any one time.

PB version: 12.5

GhostScript version: 8.71 and 9.10 64bit.

Database: SQL Server

The image file is a PNG that covers the entire page. It is about 2650 KB in size. The report is tax form W-2 4 Part which has 4 copies of the form on one page so each page is for a different employee. The employee then uses the companion web application (not written in PB) to download or print the form.

I have looked into using Amyuni for speed purposes but management is reluctant to make that sort of change unless absolutely necessary. Any tips on reducing disk usage or improving the speed of GhostScript would be appreciated.

Ronnie Po Accepted Answer Pending Moderation
  1. Wednesday, 6 December 2017 17:38 PM UTC
  2. PowerBuilder
  3. # 1

That PNG file is relatively huge. Is it just an image of the lines and boxes of the form?

  1. Roland Smith
  2. Thursday, 7 December 2017 13:21 PM UTC

  1. Helpful
  1. Ronnie Po
  2. Thursday, 7 December 2017 17:24 PM UTC
I've wrestled with these same issues, but I've managed to get good results using GhostScript.

Here are a couple of ideas that might help:

1. Optimize that PNG image. Even at 600 ppi, if it's black and white, or just one or two solid colors, you should be able to reduce the size down to 200-300K. As a quick test to see whether this is worth the effort, first just substitute any 250K PNG image as a placeholder and run some benchmarks.

2. Get rid of the image entirely, and model the full form - boxes, lines and all - in the DataWindow painter. I did this some years ago with the CMS-1500 medical claim form. It took nearly a full day, but the payoff was worth it. The resulting process was much more efficient with much smaller file sizes, with a greater than 10x improvement, even with thousands of bills in a single print job.

  1. Helpful
  1. Olan Knight
  2. Monday, 11 December 2017 23:24 PM UTC
One way to reduce the size of that enormous PNG file:  https://tinypng.com/


Later -



  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.