raikar_raviraj
9th May 2008, 08:06
Hi,
While creating output in PDF i am facing a proble. I am using ghostscript version 8.57. The '@._gs1' and '.ps' file is getting generated properly.
But .pdf file is not getting generated.
Following is the code that i am using for creating PDF File.
function create_pdf()
{
long fp1 | File to create PDF File.
string tmp.file1(1024)
| Convert file.
convert_file("POSTSCRIPT")
local.path = local.path & ".PDF"
|Create some temp files.
tmp.file1 = creat.tmp.file$( bse.tmp.dir$() )
|Open the temp files.
fp1 = seq.open(tmp.file1, "w")
| Put Ghostwriter stuff
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite", fp1)
seq.puts("-sOutputFile#"&local.path, fp1)
|seq.puts("-sPAPERSIZE=a4",fp1)
|seq.puts("-dDEVICEWIDTHPOINTS = 880",fp1)
seq.puts("-dDEVICEHEIGHTPOINTS = 1200",fp1)
|seq.puts("-sPDFPassword=baan",fp1)
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -c save pop -sOutputFile#"&local.path & " -f " & local.path(1;(len(local.path)-3))&"ps", fp1)
| Close the files.
seq.close(fp1)
| Move these two files to the c drive.
send.report.to.client(tmp.file1, "c:\_.gs1")
|Move the postscript file to the client.
err2 = server2client( tmp.file, local.path(1;(len(local.path)-3))&"ps",1)
| Setup filename to start.
ret = rdi.domain.enum.value( "tugs",1,"2",app1,appl,fval)
ret = app_start("gswin32c.exe " & "@_.gs1", "c:\","","","")
|ret = app_start(appl & " @_.gs1", "c:\baan\","","","")
| Make sure GS is completed before launching Acrobat.
if ret >= 0 then
| not equals
while app_status(ret) <> 0
suspend(500)
endwhile
else
message("Error %d encountered while starting Ghostscript", (-1 * ret))
endif
|Delete old temp file.
ret = seq.unlink(tmp.file)
ret = seq.unlink(tmp.file1)
| Start adobe acrobat
ret = rdi.domain.enum.value( "tugs",4,"2",app1,appl,fval)
start= "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & " " & local.path
| Start the aplication.
start_app()
}
It was creating perfectly fine year ago. Now when i tried using it it has stopped working.
While creating output in PDF i am facing a proble. I am using ghostscript version 8.57. The '@._gs1' and '.ps' file is getting generated properly.
But .pdf file is not getting generated.
Following is the code that i am using for creating PDF File.
function create_pdf()
{
long fp1 | File to create PDF File.
string tmp.file1(1024)
| Convert file.
convert_file("POSTSCRIPT")
local.path = local.path & ".PDF"
|Create some temp files.
tmp.file1 = creat.tmp.file$( bse.tmp.dir$() )
|Open the temp files.
fp1 = seq.open(tmp.file1, "w")
| Put Ghostwriter stuff
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite", fp1)
seq.puts("-sOutputFile#"&local.path, fp1)
|seq.puts("-sPAPERSIZE=a4",fp1)
|seq.puts("-dDEVICEWIDTHPOINTS = 880",fp1)
seq.puts("-dDEVICEHEIGHTPOINTS = 1200",fp1)
|seq.puts("-sPDFPassword=baan",fp1)
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -c save pop -sOutputFile#"&local.path & " -f " & local.path(1;(len(local.path)-3))&"ps", fp1)
| Close the files.
seq.close(fp1)
| Move these two files to the c drive.
send.report.to.client(tmp.file1, "c:\_.gs1")
|Move the postscript file to the client.
err2 = server2client( tmp.file, local.path(1;(len(local.path)-3))&"ps",1)
| Setup filename to start.
ret = rdi.domain.enum.value( "tugs",1,"2",app1,appl,fval)
ret = app_start("gswin32c.exe " & "@_.gs1", "c:\","","","")
|ret = app_start(appl & " @_.gs1", "c:\baan\","","","")
| Make sure GS is completed before launching Acrobat.
if ret >= 0 then
| not equals
while app_status(ret) <> 0
suspend(500)
endwhile
else
message("Error %d encountered while starting Ghostscript", (-1 * ret))
endif
|Delete old temp file.
ret = seq.unlink(tmp.file)
ret = seq.unlink(tmp.file1)
| Start adobe acrobat
ret = rdi.domain.enum.value( "tugs",4,"2",app1,appl,fval)
start= "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & " " & local.path
| Start the aplication.
start_app()
}
It was creating perfectly fine year ago. Now when i tried using it it has stopped working.