ll_printed = dw_1.print(FALSE)
IF ll_printed = 1 AND FileLength64(gs_TmpFile) > 100000 THEN
ls_run =gs_GhostScript_Path + "gswin32c -q -sDEVICE=pdfwrite
-sOutputFile=" + gs_TmpFile + ".pdf " + " -dBATCH -dNOPAGEPROMPT -dNOPROMPT-dQUIET -dNOPAUSE" +' ' + gs_TmpFile
END IF
I got this script where I check the file length, I always generate a PS with 11kb. If i continue to create a pdf. it will create a blank PDF. Sometimes It actually print the correct information sometimes its blank.
Well, you appear to be testing the size of gs_TmpFile to see if its more than 100,000 bytes, and yet you say you always generate an 11Kb (11264 bytes) PostScript program, so I can't see how you ever manage to invoke Ghostscript in that case.
I'd guess that your temporary file is still not complete, or does not contain what you think it does.
Of course, you have set -dQUIET, suppressing messages, and not bothered to provide (or even capture) the Ghostscript transcript. Most likely there's something in there that would give you a clue, but since you haven't presented it, nobody can tell.
You need to do considerably more debugging of this yourself. You should capture the PostScript program at the time you invoke Ghostscript (copy it to a new file), and also capture the Ghostscript output. Then examine the PDF file that is created, until you hit your error condition.
When you hit the error condition you will be in a position to compare the PostScript program that was sent to Ghostscript with a working version, and you will have any information Ghostscript wanted you to be aware of, which may help you debug the problem.
There's really not sufficient information here to offer any more help.