Dear All,
Has anybody managed to use the PDFlib http://www.pdflib.com/ with OpenACS and AOLserver (RH Linux 8.0)? I have been trying for two days, but can't really get it to work. PDFlib works really fine and creates very nice PDF output fast from tcl-scripts (example code for tcl is included in the pdflib files. For example, I write "tclsh hello.tcl" and abrakadabra - there it goes "hello.pdf" is created. But when trying to do the same thing from a web page on OpenACS/AOLserver, it returns error that it "can't find the package pdflib 4.0". This happens at it tries to execure the "package require pdflib 4.0" command within the hello.tcl script. I tried (and managed - at least no errors) to load pdflib as a module in AOLserver, but it still does not work.
I admit, I am a newbie.
Any ideas anyone? Maybe it is the hello.tcl script that is something wrong with to run it from a web page?
I have checked out the HOWTO thing for OpenACS and PDF in this thread, but it looks a bit complicated to have Python scripts when everything else is based on tcl.
Any help or ideas would be appreciated. My objective is, of course, to be able to generate PDF-files on the fly from database content and serve the over the web using tcl scripts.
All the best,
/Fredrik Björck
----
Here's the hello.tcl I am trying to run from the web (the only file - do I need also an ADO-file or html file or something?
#!/bin/sh
# $Id: hello.tcl,v 1.9.2.1 2002/01/22 19:49:34 tm Exp $
#
# PDFlib client: hello example in Tcl
#
# Hide the exec to Tcl but not to the shell by appending a backslash\
exec tclsh "$0" ${1+"$@"}
# The lappend line is unnecessary if PDFlib has been installed
# in the Tcl package directory
# package require pdflib 4.0
set p [PDF_new]
if {[PDF_open_file $p "hello.pdf"] == -1} {
puts stderr "Couldn't open PDF file!"
exit
}
PDF_set_info $p "Creator" "hello.tcl"
PDF_set_info $p "Author" "Thomas Merz"
PDF_set_info $p "Title" "Hello world (Tcl)"
PDF_begin_page $p 595 842
# Change "host" encoding to "winansi" or whatever you need!
set font [PDF_findfont $p "Helvetica-Bold" "host" 0 ]
PDF_setfont $p $font 18.0
PDF_set_text_pos $p 50 700
PDF_show $p "Hello world!"
PDF_continue_text $p "(says Tcl)"
PDF_end_page $p
PDF_close $p
PDF_delete $p