~Vamsi
8th December 2001, 02:39
Extract of the file...
|******************************************************************************
| Notes for posting on Baanboard.com
| This was posted initially to baanfans.com in August 2000.
| Joy Conner's posting for this functionality has prompted me to look it up
| in my archives.
|
| It would be nice if someone irons out the logic to be generic for both
| Unix and NT. As usual my Achille's heel continues to be documentation.
| Will some kind soul write documentation for this. Also possible is to combine
| this script with the one posted by Mark Holland at
| http://www.baanboard.com/baanboard/showthread.php?s=&threadid=513
|
| ~Vamsi
| 7th December, 2001
|******************************************************************************
long ret
string tmp.file(1024)
string pdf.tmp.file(1024)
#pragma used dll ottdllbw
#pragma used dll ottdllinputstr
function main()
{
long i
domain tcmcs.str100 local.path
| Convert the report file
tmp.file = creat.tmp.file$( bse.tmp.dir$() )
wait.and.activate("ttstpconv", argv$(1), tmp.file, argv$(3), argv$(4))
| ensure argv$(3) has a value "POSTSCRIPT"
mark_h
9th December 2001, 01:19
Vamsi,
(1) Thanks Vamsi. You gave a interesting idea. In this version you select the printer with a version of this script and THEN it launches a sub-session which asks if you want to create a PDF file, launch word or excel. I am sorry to say it is still only a UNIX version. Hopefully we can add other useful conversions. Maybe a Email section or a text session.
(2) Is there a way to tell if you on NT client or server? Is that what the fix slash is for? If so a check could be built in that would fix the slashes for NT.
(3) I downloaded Ghostscript and tested this, but since I do not know ghostscript I think something is wrong with the format. Hopefully you or someone else can fix this. Check the PDF file in the attachment.
(4) Hope new documentation is enough for others to get started.
Mark
PS: Do not hold it against me if I forgot to attach something. I had to come to work, so I took a few hours and rushed through this.
Teaser of the script:
|******************************************************************************
|* Title : Create PDF Output from Baan
|* Author : MohanaVamsi Potluru <vamsi@who.net>
|* Date : August 02, 2000 at 14:09:13 EST
|* Requirements : Ghostscript,MS word, MS excel.
|* Location of word and excel and ghostscript in your client path.
|* Domain Created tugs with values
|* tugs.loc = gswin32c.exe
|* tugs.excel = excel.exe
|* tugs.word = word.exe
|******************************************************************************
|* Script Type : Library
|* Description : Creates PDF,word or excel
|* Category : Output Management
|* License :
|* Platform : UNIX
|* Copyright 2000- by MohanaVamsi Potluru
|*
|* All Rights Reserved
|*
|* Permission to use, copy, modify, and distribute this software and its
|* documentation for any purpose and without fee is hereby granted,
|* provided that the above copyright notice appear in all copies and that
|* both that copyright notice and this permission notice appear in
|* supporting documentation.
|*
|* MohanaVamsi Potluru and Baanboard.com DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|* AND FITNESS, IN NO EVENT SHALL MohanaVamsi Potluru nor Baanboard.com BE LIABLE FOR ANY
|* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|* OR PERFORMANCE OF THIS SOFTWARE.
|******************************************************************************
|*
|******************************************************************************
|* This is just a rev 0.1 - almost nothing more than an idea.
|* Download and install Ghostscript http://www.cs.wisc.edu/~ghost/
|* Initial revision - MohanaVamsi Potluru
|* based on the Wrapper Program - Kevin Brock
|* Modification by Mark Holland
|*
extern domain tgyenox opt.pdf |Create PDF file.
extern domain tgyenox opt.word |Start word with file.
extern domain tgyenox opt.excel |Start excel with file.
| Variables need for the conversion program.
string tmp.file(1024) | Temporary file name.
string local.path(1024) | Location on client for report.
long ret | Return code.
string appl(132) | Application to start.
long app_id | Application id.
string start(1024) | Parameter for the app_start
| function which has application
| and file to use.
string app1(132) | Used for RDI domain
long fval | Used for RDI Domain
#pragma used dll ottdllbw
#pragma used dll ottdllinputstr
function main()
{
| Export variables for sub-session.
export("opt.pdf",opt.pdf)
export("opt.excel",opt.excel)
export("opt.excel",opt.word)
| Launch sub-system to find out what they want to do.
zoom.to$("tuddc9130s000",z.session,"","",0)
| Import variables.
import("opt.pdf",opt.pdf)
import("opt.word",opt.word)
import("opt.excel",opt.excel)
| Go do what they want.
if(opt.pdf = tgyenox.yes) then
create_pdf()
endif
if(opt.word = tgyenox.yes) then
create_word()
endif
if(opt.excel = tgyenox.yes) then
create_excel()
endif
}
mark_h
18th December 2001, 23:35
This new version contains a section to launch the display. I also tweaked the GS section to work for our site - it now launches acrobat.
Thanks to Vamsi for the original script and to Gordon for providing me with info on calling the display.
Mark
|******************************************************************************
|* Title : Create PDF Output from Baan
|* Author : MohanaVamsi Potluru <vamsi@who.net>
|* Date : August 02, 2000 at 14:09:13 EST
|* Requirements : Ghostscript,MS word, MS excel.
|* Location of word, excel, ghostscript and acrobat
|* in your clients path.
|* Domain Created tugs with values
|* tugs.loc = gswin32c.exe
|* tugs.excel = excel.exe
|* tugs.word = word.exe
|* tugs.acrobat = acrord32.exe
|******************************************************************************
|* Script Type : Library
|* Description : Creates PDF,word or excel
|* Category : Output Management
|* License :
|* Platform : UNIX
|* Copyright 2000- by MohanaVamsi Potluru
|*
|* All Rights Reserved
|*
|* Permission to use, copy, modify, and distribute this software and its
|* documentation for any purpose and without fee is hereby granted,
|* provided that the above copyright notice appear in all copies and that
|* both that copyright notice and this permission notice appear in
|* supporting documentation.
|*
|* MohanaVamsi Potluru and Baanboard.com DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|* AND FITNESS, IN NO EVENT SHALL MohanaVamsi Potluru nor Baanboard.com BE LIABLE FOR ANY
|* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|* OR PERFORMANCE OF THIS SOFTWARE.
|******************************************************************************
|*
|******************************************************************************
|* This is just a rev 0.1 - almost nothing more than an idea.
|* Download and install Ghostscript http://www.cs.wisc.edu/~ghost/
|* Initial revision - MohanaVamsi Potluru
|* based on the Wrapper Program - Kevin Brock
|* Modification by Mark Holland
|*
extern domain tgyenox opt.pdf |Create PDF file.
extern domain tgyenox opt.word |Start word with file.
extern domain tgyenox opt.excel |Start excel with file.
extern domain tgyenox opt.display |Start the display.
| Variables need for the conversion program.
string tmp.file(1024) | Temporary file name.
string local.path(1024) | Location on client for report.
long ret | Return code.
string appl(132) | Application to start.
long app_id | Application id.
string start(1024) | Parameter for the app_start
| function which has application
| and file to use.
string app1(132) | Used for RDI domain
long fval | Used for RDI Domain
#pragma used dll ottdllbw
#pragma used dll ottdllinputstr
#pragma used dll ottdlldisplay
function main()
{
| Export variables for sub-session.
export("opt.pdf",opt.pdf)
export("opt.excel",opt.excel)
export("opt.excel",opt.word)
export("opt.display",opt.display)
| Launch sub-system to find out what they want to do.
zoom.to$("tuddc9130s000",z.session,"","",0)
| Import variables.
import("opt.pdf",opt.pdf)
import("opt.word",opt.word)
import("opt.excel",opt.excel)
import("opt.display",opt.display)
| Go do what they want.
if(opt.pdf = tgyenox.yes) then
create_pdf()
endif
if(opt.word = tgyenox.yes) then
create_word()
endif
if(opt.excel = tgyenox.yes) then
create_excel()
endif
if(opt.display = tgyenox.yes)then
create_display()
endif
}
~Vamsi
14th August 2002, 02:16
Ajitdon wrote:
Hi Vamsi,
I have used your solution to print in PDF and tweaked the hard coded portions
to suit my environment.
For an intial test, I have hard coded the start_app(.... as follows:
app_id = app_start(start, "","","","")
WHERE : start = "AcroRd32.exe" & " " & "c:\temp\ajit.ps" .
ajit.ps is the file being created in c:\temp.
When I run the program in debug , it starts acrobat but gives me the error
message -
"There was an error opening this document. A file read error has occured".
Would you know why I am getting this error?
Thanks for your time,
Ajit.
Ajit,
Open a command prompt on your local pc and try the command. Whatever works on your local pc is what you want to put in the Baan script. At first looks, I believe you are trying to open a postscript file in Adobe Acrobat Reader. To my knowledge this is not supported. Acrobat reader only supports pdf files.
ajitdon
21st August 2002, 21:10
Vamsi, Mark:
I am trying to print in PDF using Mark's version(pdfvers31.zip) for UNIX as a starting point.
ENVIRONMENT:
Baan Server - Unix.
Client - Windows 2000
Ghostscript (gs653w32.exe) present in d:\baan\tmp
DEVICE MANAGER SETUP:
Device - PDFIT
Type - Rewrite
Locale - ISO-8859-1
4GL Program - otccomconv4
Argument - POSTSCRIPT
Path - d:\baan\tmp\ajit
PROBLEM:
It seems Ghostwriter is not creating the ajit.pdf file.
The ajit.ps file is being created in d:\baan\tmp
However, it seems that the ajit.pdf file is not being created by Ghostwriter.
I am reproducing the code for function create.pdf() below :
|***************
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("-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, "d:\BAAN\tmp\_.gs1")
|Move the postscript file to the client.
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)
appl = "d:\BAAN\tmp\gs653w32.exe"
ret = app_start(appl & " @_.gs1", "d:\BAAN\tmp.ps","","","")
| 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
appl = "AcroRd32.exe"
ret = rdi.domain.enum.value( "tugs",4,"2",app1,appl,fval)
start= appl & " " & local.path
| Start the aplication.
start_app()
}
|**********
The problem seems to be within the code that is calling the ghostwriter.
I have tried two variations:
(1) | Setup filename to start.
ret = rdi.domain.enum.value( "tugs",1,"2",app1,appl,fval)
appl = "d:\BAAN\tmp\gs653w32.exe"
ret = app_start(appl & " @_.gs1", "d:\BAAN\tmp","","","")
When using this, at this command the ghostwriter install pop up starts and I have to go through the complete ghostwriter installation everytime - still no ajit.pdf file is created.
(2) | Setup filename to start.
ret = rdi.domain.enum.value( "tugs",1,"2",app1,appl,fval)
appl = "d:\BAAN\tmp\gs653w32.exe"
ret = app_start(appl & " @_.gs1", "d:\BAAN\tmp.ps","","","")
When using this, at this command, nothing seems to happen. The debugger just goes through it very quickly. Again, no ajit.pdf file is created.
|***************
In both cases, at the command that launches acrobat,
[[ app_id = app_start(start,"","","","")
Where: start = "AcroRd32.exe d:\baan\tmp\ajit.pdf" ]]
the acrobat reader application is launched but it gives a pop up error message - " There was an error opening this document. The file does not exist."
It seems because of some problem with the ghostwriter, the ajit.pdf file is not being created.
Please advise.
Thanks for your time,
Ajit.
Eddie Monster
21st August 2002, 21:57
Ajit,
You have a line of code in you post:
ret = app_start(appl & " @_.gs1", "d:\BAAN\tmp.ps","","","")
| Make sure GS is completed before launching Acrobat.
Shouldn't it read:
ret = app_start(appl & " @_.gs1", "d:\BAAN\tmp","","","")
| Make sure GS is completed before launching Acrobat.
Wasn't quite sure... I was just comparing your code to code I modified to get it to work...
Also under Control Panel in windows I have set up the following System path: D:\gs\gs7.03\bin
so that all I have to call is:
appl = "gswin32c.exe"
ret = app_start(appl & " @_.gs1", "c:\temp","","","")
to run the Ghostwrite and not have to go through the entire install.
Hope this helps...
ajitdon
21st August 2002, 23:13
Hi Eddie,
Thanks a lot!
That was the problem.
Now it works for me!.
However, that is the problem - it only works for me.
Will I have to install ghostrscript on all PCs that should be able to use it? Or is their an easier way to install the ghostwriter on the server (Unix for us?) or can we have ghostwriter on
Has anyone tried this?
Thanks again - Eddie:)
Ajit.
Eddie Monster
21st August 2002, 23:40
My company only has a few finance people actually printing .pdf reports from Baan to our Intranet. Then all other management review these reports so we don't need many people printing in PDF format. Each of these people have Ghostwriter installed on their individual PC.
However, I believe that GhostWriter has a network version that could be set up so that all networked users could access it. We were going to look at it when we have time, but you know how that goes...
~Vamsi
22nd August 2002, 00:39
Folks,
I released the code with it implemented on the local pc because I do not have a business need for it to be present on the server :). Install Ghostscript on the Baan server (it is available for all flavours of unix and windoze) and make changes to create the pdf on the server instead of the client.
Good luck
Francesco
30th August 2002, 10:45
I switched version 7.05 for 6.53 and it compiled for me (with minor problems).
Solaris users beware.
Francesco
6th September 2002, 21:28
I finally managed to get a working concept of the Unix installation.
First of all, installing ghostscript on Solaris is no picnic. It took me several days to get it to compile and then several more to get it to compile properly.
Maybe it would have helped if I actually knew what I was doing? ;)
I still have some issues with the way gs is producing its PDF files, probably due to incorrect fonts or stuff...anybody here with extensive adobe knowledge?
But I'll get that fixed down the road.
Then Mark's code wouldn't run for me at all, vamsi's code wouldn't produce any results, so I ended up with a very stripped down version that looks like this:
domain tcmcs.str100 local.path
| Convert the report file
tmp.file = creat.tmp.file$( bse.tmp.dir$() )
wait.and.activate("ttstpconv", argv$(1), tmp.file, "POSTSCRIPT", argv$(4))
local.path = argv$(2)
| make sure the final file has a valid extension
if rpos(toupper$(local.path), ".PDF") <> (len(local.path) - 3) then
local.path = local.path & ".pdf"
endif
gs.path = "/opt/apps/baan/gs/6.53/bin/gs"
gs.options = "-dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=- -dBATCH " & tmp.file & " > " & local.path
gs.command = gs.path & " " & gs.options
| ret = run.prog(gs.path, gs.options, RP_WAIT)
ret = shell( gs.command, SHELL_MWINDOW )
ret = seq.unlink(tmp.file)
Notice I had to use the shell() function instead of the run.prog() to get it to work (thanks for the tip, Prashanth). If anybody has any idea why run.prog wouldn't work as entered in the above code, I'd like to hear it.
Also, both Vamsi's and Mark's versions have the script type 'library' in the code. This needs to be 3GL (thank you vamsi for this clarification).
I will have to incorporate some more code to move the pdf files to the right destination based on what user, etc. But this is the gest of it.
Remind me to attach the Solaris make file so other poor souls don't have to go through this part of the struggle.
mark_h
6th September 2002, 21:45
Francesco,
Glad you got it working. As for the run.prog - I wonder if it would have the same problem I had with the sed program. Had to put some quotes around the commands. Below worked for me and I wonder if it could be something like that in this case. Just a guess.
sed.cmd = sprintf$("-c %ssed -f %s %s>%s%s",
chr$(34), tmp.sed.file, return.file, tmp.sed.output.file, chr$(34))
status = run.prog("sh",sed.cmd,RP_WAIT)
Thanks for your contribution.
Mark
Francesco
10th September 2002, 19:56
Here is the makefile that ended up working for me.
Of course it will need adjustments for any particular environment, but it should give some hints to people trying to install ghostscript on Solaris.
good luck.
therese
18th September 2002, 11:17
I used the program of Vamsi. I didn't encountered any error. There is a pdf file created but when I try to open the pdf file, the error "There was an error opening this document. The file cannot be open because it has no pages".
What seems to be the problem?
Please help.
Thanks,
Therese
therese
18th September 2002, 11:44
Hi again,
Please ignore my previous message. I already solve the problem.
I have created pdf file without any error but when I check the report output, it double the pages. The file must supposed to have only one page but it created another page (page 2) with same data.
Thanks.
therese
18th September 2002, 11:53
Hello,
I have created pdf file based on Vamsi's program posted on Code and Utilities.
When I checked the content of the file, it doubles the pages of the report. What i mean is another page is created with the same data of the previous page. Instead of creating only one page it creats two pages.
What seems to be the problem?
Attached is the pdf file generated at my end.
rochus
18th September 2002, 19:31
one question,
how do you manage with this fantastic tool
printing in landscape (acrobat, word)
in my version he takes always the predefined
values.
thanks
Eddie Monster
18th September 2002, 20:32
I created two different print devices the Landscape version uses this line of code
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -dDEVICEWIDTHPOINTS#936 -dDEVICEHEIGHTPOINTS#792 -c save pop -sOutputFile#" & local.path & " -f " & local.path(1;(len(local.path)-3))&"ps", fp1)
instead of:
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -c <</PageSize[792 729]>>setpagedevice save pop -sOutputFile#" & local.path & " -f " & local.path(1;(len(local.path)-3))&"ps", fp1)
The above code is part of Ghostscript command lines. I am certainly no expert with Ghostscript. I had to play around with the point values to get it to work. If you convert from points to inches (divide by 72) you actually get a width of 13 inches and a height of 11 inches. If I tried to use 8.5 high by 11 wide my headers and footers were being cut off by the conversion.
rochus
18th September 2002, 20:44
this was my idea too,
but i placed the values before the
device argument, that was wrong
now it works
thanks a lot
Xikkos
10th October 2002, 23:30
Hi all,
Where can I find and download the ghostscript application for UNIX-Solaris and how can I install it, Id tried some distribution and I did not have success.
Regards,
Xikkos.
mark_h
10th October 2002, 23:40
Try this link (http://www.cs.wisc.edu/~ghost/).
Mark
Francesco
11th October 2002, 18:44
The place to actually download ghostscript would be here (http://sourceforge.net/project/showfiles.php?group_id=1897&release_id=73729).
You will also need to obtain (if you don't have them already), copies of the jpeg files and the libpng files.
I didn't write down where I ended up getting those, I think there is a reference to the jpeg place in the GS documentation. Any search engine will direct you to libpng.
Good luck compiling this SOB. If you need any help, send me an email through Baanboard. I won't be too available for the next weeks, but I'll do what I can.
Binnicol
17th October 2002, 11:08
Hello, I need some help, please?
I have a problem with PDF files. The document PDF don´t appears in the PC.
In the process I don´t have any problem, and run then Acrobat reader and appears the message "Error while open document. File don´t exist."
I think that is the secuence of commands for the gswin23c.exe:
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite", fp1)
seq.puts("-sOutputFile#"&local.path, fp1)
seq.puts("-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -c save pop -sOutputFile#"&local.path & " -f " & local.path(1;(len(local.path)-3))&"ps", fp1)
no?
Thaks
OmeLuuk
17th October 2002, 15:34
there have been pdf problems in ttstpconv... see KB for solutions
lvdvelde
23rd January 2003, 15:26
Hey everybody,
Thanks for the great ideas about printing PDF files.
I got Ghostscript running on a Digital Unix system, and use the selection option menu for Word, Excel, Outlook, Internet Explorer, Notepad, Wordpad and Acrobat PDF.
Still there's one problem: how do I handle a Baan report over 66 lines, and 132 columns (or more)? Right now it doesn't fit on a "regular" A4.
Here are the Ghostscript options I use:
gs.options = "-q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=- -sPAPERSIZE=a4 -c save pop -dBATCH " & tmp.file & " > " & local.path
Thanx, Lex
lvdvelde
5th February 2003, 11:42
Hi again,
I managed to solve the problem:
When the user selects PDF output I added some spooling options:
if (opt.pdf = tgyenox.yes) then
spool.fontnumber = 2
spool.paper.type = "PS"
spool.pg.length = 60
create_pdf()
endif
These are the options given to Ghostscript (no page size specified)
gs.options = "-q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=- " & "-c save pop -dBATCH " & tmp.file & " > " & "baanrprt.pdf"
Maybe this is helpful for other PDF warriors...
Greetz, Lex
trchandra
13th March 2003, 01:04
Guys,
I was looking at different options available for printing PDF documents from Baan and I came across this tool called "PDF995" available at
http://www.pdf995.com/download.html
This tool is free and you can create PDF documents just like that!
Steps :
1. Download this pdf995 from the above URL
2. Extract the file from zip and install it.
3. This will install a printer on the local machine with name "PDF995"
How to create PDF documents:
1. Print documents from Baan with option to "Preview"
2. When the document appears in preview, goto
File->Print
3. Select the installed printer "PDF995"
4. Give a file name when it prompts and the file will be created!
5. Good thing is this will take images/logos created for baan documents
6. Annoying part is everytime this printer device is used, their promo page appears in explorer. You can avoid this by getting license key.
günther
16th September 2003, 12:02
We've been using GhostScript to convert Postscript into PDF for a long time (server side, HP-UX).
Now I'm playing with GhostPDF which looks very similiar to GhostScript buts converts HP LaserJet Controls Commands ("PCL") into PDF. At the moment I have some technical problems (GhostPDF compiled under HP-UX gives correct and results on page 1, but pages 2ff are black - GhostPDF compiled under Linux gives correct pages but Acrobat reader at least complains a bit). Hovever the output looks *yery* nice!
Anyone else any experiences with GostPDF?
sylvain.carbon
3rd December 2003, 17:22
Hello,
I have a baan version in production BaaN CIV SP 6 and I use the Vamsi version with gohstscript and it run good.
But in baan test version I have BaaN CIV SP 13 and now the same program don't run good.
In fact when I convert my temporary file into POSTSCRIPT file I have two different files. One in production server and another one different on test server.
After when I try to convert my Postscript file with gohstscript, it's ok for the test server and bad for the production server.
Please help me.
Best regards.
rochus
3rd December 2003, 17:43
try newer version of ttstpconv
or copy old object from prod.server
sylvain.carbon
3rd December 2003, 18:18
OK if I take the old version of the file ostpconv it runs good.
If I run with the new version of ttstpconv the conversion don't run. But I am not sure that I tried with the last version of the object. Can you give me the last version ?
I am not sure that the solution is to keept the old version because I think that some other bug are fixed with the last version ?
Please help
mark_h
3rd December 2003, 18:22
Please contact Baan or use Baan support Web page for the latest version of any object. Please do not post or request Baan objects - especially tools object or libraries, no telling what they may break, it would be better to get these from Baan.
Thanks
Mark
rochus
3rd December 2003, 20:46
you should use "search for latest session version"
under www.support.baan.com
you can download via multilevel-download-tool,
than you will have correct dependency for pmc.
otherwise there's no big risk using old
ttstpconv, it is used only
for converting to files and if you have no other problems
in htis area ...
~Vamsi
3rd December 2003, 23:22
Sylvain,
Could you post the two differing Postscript files from the two versions of ttstpconv.
sylvain.carbon
4th December 2003, 09:50
this first file is the postscript file that I can convert to PDF with gohstscript.
(I not know how to attach two file into one message so please read the next message)
sylvain.carbon
4th December 2003, 09:51
Into this message you can find the postscript file that I cannot convert to PDF file.
This postscript file is made with the last ttstpconv.
Thanks for your help
Best regards
rochus
12th December 2003, 18:26
we are printing over this tool in iso-8859-1
without problems.
but reports in eastern-europe-lang (f.i. polish),
the special characters are wrong.
i created a second postscript-printer,
connect to ISO-BIN2, but no difference in files.
in the postscript-file i found
ISO-LATIN1. (we need ISO-LATIN2).
for me it lokks, that ttstpconv are fixed to
ISO-LATIN1.
does anybody have an idea, what i need for EE.
maybe other fonts for ghostview ?
thanks
Punitha
1st September 2004, 21:17
We've been using GhostScript to convert Postscript into PDF for a long time (server side, HP-UX).
Now I'm playing with GhostPDF which looks very similiar to GhostScript buts converts HP LaserJet Controls Commands ("PCL") into PDF. At the moment I have some technical problems (GhostPDF compiled under HP-UX gives correct and results on page 1, but pages 2ff are black - GhostPDF compiled under Linux gives correct pages but Acrobat reader at least complains a bit). Hovever the output looks *yery* nice!
Anyone else any experiences with GostPDF?
Gunther,
I have been trying for the past couple of days to compile the downloaded ghostscript for the Unix flavor and I have been unsuccessful. We are on HP-UX 11.11. I saw your message that you have been successfully using ghostscript to do the conversion for you. Would you be able to guide me as to where I am going wrong. As per the ghostscript documentation, I have downloaded all the ghostscript sources including the required 3rd party libraries(jpeg, png, zlib). I did the "configure" first which successfully created the "makefile". But when I execute the "make", I get the following compilation error message in the "./src/genconf.c":
ERROR: "Undefined symbol: size_t. function prototypes are an ansi feature. type of "<<NULL_SYMBOL>>>" is undefined due to an illegal declaration.
Can you help me out?
Thanks in advance,
Punitha
dave_23
2nd September 2004, 06:40
"Function prototypes are an ANSI feature."
You need an ANSI compiler. Get GCC HP has a package for it.
They probably also have a precompiled package for ghostscript
while you're at it.
Dave
günther
2nd September 2004, 08:11
Punitha,
there are somethings to note: 1) "undefined symbol: size_t", 2) "function prototypes are an ansi feature" and 3) "type of "<<>" is undefined due to an illegal declaration".
I would like to start with 2. Obviously, you are compiling with an non-ANSI C Compiler. => If you run "type cc" the answer might be "cc is a tracked alias for /usr/bin/cc". That compiler is okay for compiling the kernel, but not useful for most other applications!
=> Any other C compilers available on your system? HP-UX ANSI-C compiler such as /opt/ansic/bin/cc? GNU-C eg. as /usr/local/bin/gcc?
Next is 1. size_t is normally a type definition that comes from #include <sys/types.h>.
=> Try the following to verify your C compiler: make a new directory. create a file test.c with the following content:
#include <sys/types.h>
size_t s;
int foo(size_t s) /* that is a "modern" declaration */
{
}
int bar(s) /* that is a kernighan/ritchie style declaration; */
int s; /* works since 1970 ... */
{
}
To compile this file x.c into an object x.o, say "cc -c x.c". Try this for some other C ompilers (if you have).
Finally 3. Hmmh! That looks like C++, but could also be an error; "<>" or "<<"?. Btw. What version of ghostscript are you trying to compile?
Günther
Punitha
2nd September 2004, 15:22
Thank You Dave.
I think I'll do just that. I'll get the complete compiler version for HP.
PS: I did try downloading "gcc" and I had a similar problem and "gcc" websource had suggested that the same. The site recommends downloading the latest patches so that there is no problem with linking, compiling during the build and also to have the complete compiler version(just as you had suggested).
Thanks again Dave. I'll do the same and post my results here as soon as I can,
Punitha
Punitha
2nd September 2004, 15:53
Thank You Gunther. I appreciate your help.
Yes, It does seem like I don't have the ANSI C compilation version. I tried your sample program and I received a compilation error for the "modern type or ANSI function declaration" and "knr" style didn't have any problems.
I also did a "swlist" on my server and I didn't find any "ANSI" software set loaded. Also I did a "cc -A" which verifies if I have the ANSI compilation option available and I got an error that "-A option is supported only in ANSI C compilers".
I had also downloaded "gcc" from "gcc.gnu.org(Thank You FSF!)". But, when I built it, I got the same type of compilation error message and from what I saw on the Web, I definitely will have to get the proper compiler(just as you had suggested).
So, I am going to research and find out what patches/pkgs I have to apply to our current software list to allow ANSI C compilation.
Thanks Gunther.
To the moderator:
=============
BTW, I had also opened a new thread yesterday and Dave had suggested the same reply as Gunther. I am wondering if it's possible for me to merge my new thread that I had started and this thread together.
Punitha
2nd September 2004, 16:42
BTW, Gunther, I forgot to mention in my reply the ghostscript versions that I had tried - 8.14, 8.01, 7.07. I had played around all the three versions assuming that as I dropped down the version level, the statement syntaxes might agree with whatever compiler version I had. Duh!
Punitha
Punitha
3rd September 2004, 18:27
Thanks to the forum for their valuable help, specially, Dave and Gunther.
I downloaded various versions of "GCC" and I still couldn't build a compiler successfully to configure Ghostscript from the source.
Therefore, being on a time crunch, I chose the easier path of installing the HP-UX binaries from the software depot using "swinstall".
Here is the link to the HP-UX binaries.
http://hpux.cs.utah.edu/hppd/hpux/PostScript/ghostscript-7.07b/
Now, I have a working version of ghostscript 7.07 but I still need to smooth out a few more problems - fonts etc.,
I'll update this post further after I have done with my research,
Thanks everyone,
Punitha
Francesco
9th December 2004, 19:08
I pulled this one off the shelve this week and will be doing some upgrades on it in the next days or so.
Here is where I left off last year.
This is the server-side version of Vamsi's code. It will take your print file and dump it in pdf format in the specified directory.
If you want the pdf output to go to your local client instead, start the filename with an '*'.
Starting the filename with a '@' will email the pdf to the specified address. Oops, I forgot....that part is actually not working.....yet.
This will be updated soon but I thought I'd share my latest and greatest and let some of you do the work for me instead ;)
~Vamsi
9th December 2004, 22:40
Looked at the code. Nice touch to automatically set portrait vs. landscape.
This will be updated soon but I thought I'd share my latest and greatest and let some of you do the work for me instead ;)
You can dream :-).
Francesco
10th December 2004, 00:16
Looked at the code. Nice touch to automatically set portrait vs. landscape.
Forgot about that part.
Now why on earth am I setting the page height to 12*spool.pg.length? I remember vaguely having to analyze actual font sizing methods and stuff like that.
Did I ever mention that my memory is mostly dysfunctional?
~Vamsi
10th December 2004, 02:19
Forgot about that part.
Now why on earth am I setting the page height to 12*spool.pg.length?
Most times a line is about 12 pts high. Figured you must be multiplying the number of lines with number of pts per line.
NasimRassi
23rd March 2006, 17:30
Hi all, I did the steps to generate a PDF with ghostscript and it works fine, but when the report is LAND the right half of the report is cut or misssing.
Someone else does have the same problem? or can tell me how fix that problem?
~Vamsi
23rd March 2006, 20:05
Perhaps the post by lvdvelde on this page will help:
http://www.baanboard.com/baanboard/showthread.php?t=590&page=2
NasimRassi
23rd March 2006, 21:33
Thanks you a lot ~Vamsi, this solve my problem.
fiaamfilter
30th March 2006, 11:20
I NEWBIE please wold you send me easy information to install pdf device in my baan IV on HPUX??
i use more script (samba and lpd command) but never used program GL and i not know wher install it
grazie
NasimRassi
31st March 2006, 14:59
Hi fiaamfilter, you need to cvreate a new device, and this device must point to a the library that convert the files to pdf, like this:
fiaamfilter
5th April 2006, 09:40
i very very newbie to config baan4 on HPUX
where i copy the scripts???
i download it and.........?????
grazie
Kingsto88
17th April 2006, 11:12
Dear all,
Can someone answer these questions.
1) I see most of you who used this solution are in Unix environment, can this solution be used in windows environment??
2) Could someone please simplify the steps for me to install this solution in windows server. I am really confused after reading the whole forum thread.
3) I could not download the Ghostscript, is something wrong.
Thanks and regards
~Vamsi
17th April 2006, 17:27
I see most of you who used this solution are in Unix environment, can this solution be used in windows environment??
Yes.
2) Could someone please simplify the steps for me to install this solution in windows server. I am really confused after reading the whole forum thread.
3) I could not download the Ghostscript, is something wrong.
Here are the steps.
- Install Ghostscript on the server. Google for download locations.
- Create a 3GL script and compile it successfully.
- Create a Baan print device with arguments as specified in the thread. Ensure that the object created in step two is used in the device specification.
- Print and enjoy the results.
If you are still not successful, please post specific problem. Also if you are not comfortable installing software and compiling scripts, look to www.nazdaq.co.il for ready to go solutions.
gurmeetmakkar
25th April 2006, 08:24
how to email the report
Francesco
25th April 2006, 10:01
If you look at the server-side version, you can see where I was heading with it. There is enough information on the board about how to email a file from a unix environment.
Don't forget to post updated code!!
Kingsto88
25th April 2006, 12:25
Dear Mark or anyone,
I am using Mark's pdfvers31.zip in my server but cannot get it to work.
I am on Windows NT with Baan 4c4 and my client is Windows XP.
I am getting this message "Application start failed" all the time.
Please can someone help me and tell me what i am doing wrong.
Thanks and regards,
mark_h
25th April 2006, 15:52
That little device driver I wrote assumes that the system path on the client points to the executable. You can try including the path to the executable for testing purposes. I do not know how our current PCs are setup but it knows where to launch word, excel and acrobat from.
tritonbaan
26th April 2006, 01:00
Yes.
Here are the steps.
- Install Ghostscript on the server. Google for download locations.
- Create a 3GL script and compile it successfully.
- Create a Baan print device with arguments as specified in the thread. Ensure that the object created in step two is used in the device specification.
- Print and enjoy the results.
Any sample of such 3GL script? How the 3GL script know the path of the temporary report file?
mark_h
26th April 2006, 03:34
It is attached to the very first post. It is the file with the .bc extension. Check the script out - it should answer your questions.
raikar_raviraj
14th December 2006, 14:09
Thanks all,
I was able to incorporate the scripts provided to work for our organization..
i.e to convert the ascii file to pdf file and generate the report..
If any body has any issues regarding this you can sedn me private message.. I will be more than happy to help you out.. Well my system configuration is baan Iv c4, Windows 2000 OS and Sql server as the database..
Well i had one query.. Converting the data to pdf file works fine for portrait data.. but when i try to print data of landscape type.. it purges some of the data.. and am not able to view the entire data.. Is there any solution to tackle this.
Any solution will be highly appreciated.
mark_h
14th December 2006, 16:53
Well i had one query.. Converting the data to pdf file works fine for portrait data.. but when i try to print data of landscape type.. it purges some of the data.. and am not able to view the entire data.. Is there any solution to tackle this.
Have you seen the post by eddie monster in this thread. In is on the second page of posts. That is all I can recommend.
Andy Purdey
20th February 2007, 13:30
I came across this post when I was trying to solve the problem of creating PDF output from Baan. I can highly recommend this software, it is really easy to install and use - there are several other useful freebies on this site as well.
Thanks for putting up this post.
Guys,
I was looking at different options available for printing PDF documents from Baan and I came across this tool called "PDF995" available at
http://www.pdf995.com/download.html
This tool is free and you can create PDF documents just like that!
Steps :
1. Download this pdf995 from the above URL
2. Extract the file from zip and install it.
3. This will install a printer on the local machine with name "PDF995"
How to create PDF documents:
1. Print documents from Baan with option to "Preview"
2. When the document appears in preview, goto
File->Print
3. Select the installed printer "PDF995"
4. Give a file name when it prompts and the file will be created!
5. Good thing is this will take images/logos created for baan documents
6. Annoying part is everytime this printer device is used, their promo page appears in explorer. You can avoid this by getting license key.
jmathew
24th June 2010, 12:07
Hi,
We have been using Baan ERP LN and the operating system is Unix AIX 5.3 version. We would like to have a device defined in Baan ERP LN as "PDF" and when any reports from Baan is used for printing and we select the device "PDF" we would like the output to be printed to a file in pdf format. Please let us know the procedure to do this. Since we are new to this please explain to us in simple words. Thanks in advance.
Andy Purdey
24th June 2010, 12:20
John,
Please see the attachement, this is what we use at my company, we are now registered with PDF 995 so we don't get the banner.
I hope that you find this useful.
Regards
Andy
sramage
2nd August 2011, 12:45
Yes.
Here are the steps.
- Install Ghostscript on the server. Google for download locations.
- Create a 3GL script and compile it successfully.
- Create a Baan print device with arguments as specified in the thread. Ensure that the object created in step two is used in the device specification.
- Print and enjoy the results.
If you are still not successful, please post specific problem. Also if you are not comfortable installing software and compiling scripts, look to www.nazdaq.co.il for ready to go solutions.
Hi,
I'm new too and I don't really understand what you mean about "create a 3GL script and compile it" and how install the scripts.
I haven't the baan sources,but is it possible to do that ?
Can you give me a step by step tutorial ?
Thank you
mark_h
2nd August 2011, 14:40
See the very first post by ~vamsi it contains the source code that goes into the 3gl script. To create a 3gl script all you have to do is use ttadv2130m000 on my system which is 4c4. Insert a new script name, edit the file - then cut and paste vamsi's code into the script. At that point follow the directions and read thru this thread. There are a couple of links to where you can get the ghostscript code. I won't be much help with it since I have not touched it in years.
sramage
3rd August 2011, 09:04
Thank you for your answer.
Since I have no autorization on session ttadv2130m000, no chance to extend baan for me...