berthe
16th December 2004, 12:52
Hi,

I want to create a pdf file with WindowsXP, without user interaction.
- I created a new Device Data with Devicetype = Windows printer and Device Queue = CutePDF Writer.
- In my 4GL script I used tccom.dll0010.interact.with.device to use this new device without user interaction

This works fine: The report is printed to the pdf-printer.
The only problem is that I can not specify the output file. The user is promped with a Save As window. This is not my intention... The file should be saved to file specified in the script.


I tried to create the .pdf file in the script using app_start("c:\Program Files\GNUGS\gswin32c.exe @file1 @file2", "c:\temp\","","",""), but this doesn't work either. I think something is wrong with the function parameters in wait.and.activate("ttstpconv", arg1, tmp.file, "POSTSCRIPT", arg2).
What should i use as arg1 and arg2?

Can anyone help?
Thanks in advance!
Berthe

mark_h
16th December 2004, 16:06
There are 4 parameters:

| Arguments are passed from Baan spooler as follows:
| 1 = Name of input (temporary) file contain dev independent report
| 2 = Name of output file
| 3 = Additional arguments (from Device data)
| 4 = Specilar parm for ttstpconv (unknown reason)

A quick search of the board for ttstpconv will probably give more information on the parameters.

Mark

mark_h
16th December 2004, 16:08
Forgot to add that I do not know anything about cutePDF, but it probably works something like ghost script. You can check the solution that is posted in the code and utilities forum.

Mark

berthe
16th December 2004, 18:04
Hi,

wait.and.activate("ttstpconv", "test1.doc", tmp.file, "POSTSCRIPT", "wt") works now: I can create a .ps file, but I can not convert it to a .pdf file.

The code I use is the following:

function make.pdf()
{
long fp1, fp2
string tmp.file1(1024)
string tmp.file2(1024)
tmp.file1 = creat.tmp.file$( bse.tmp.dir$() )
tmp.file2 = creat.tmp.file$( bse.tmp.dir$() )
fp1 = seq.open(tmp.file1, "w")
fp2 = seq.open(tmp.file2, "w")
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite", fp1)
seq.puts("-sOutputFile#"&local.path, fp1)
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite", fp2)
seq.puts("-sOutputFile#"&local.path, fp2)
seq.puts("-c save pop -f " & local.path(1;(len(local.path)-3))&"ps", fp2)
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -c save pop -sOutputFile#"&local.path & " -f " & local.path(1;(len(local.path)-3))&"ps", fp1)
seq.close(fp1)
seq.close(fp2)
server2client(tmp.file1, "c:\tmp\_.vamsi1", 1)
server2client(tmp.file2, "c:\tmp\_.vamsi2", 1)
server2client(tmp.file, "c:\tmp\" & local.path(1;(len(local.path)-3))&"ps",1)
ret = app_start("c:\Program Files\GNUGS\gswin32c.exe @_.vamsi1 @_.vamsi2", "c:\temp\","","","")
return
}

mark_h
16th December 2004, 18:57
Can you convert this PS file by hand and have it work? If so then I think it is just a matter of figuring out which of the command files has the problems. You might want to make sure that what is in the app_start runs successfully. You can edit the .vamsi1 and 2 files until they work with what is in the app_start command. Then once you have the vamsi files correct you can go back to the program to make sure your seq.puts are actually building the correct command files. From the looks of things you create a file called "ps" on the client and then try to process it.

Can not help much more, it looks like you are to the point where you just need to make sure that your seq.puts are building correct scripts for cutepdf.

Mark