Originally posted by Pete
I have been asked to use tcl to do web service call to a CDR database and retrieve the documents/images and then convert them into PDF. My issue is I can retrieve the documents just fine but am having an issue converting to PDF. It looks like when I am trying to create the file it is using the actual base64 as the file name. I feel like this is something simple I am missing but most of my work has been with HL7 not document formatting or converting. Here is the section of the code where I am trying to grab the base64 and decode it.
##-----------------------------------------------------
## Create the Document
##-----------------------------------------------------
regsub -all {\\.br\\} $document "\n" document
regsub -all {\\.nf\\} $document {} document
regsub -all {\\.fi\\} $document {} document
set OBXSegGroup {}
# for dislpaying in the log:
set OBXSegGroupPrint {}
foreach line [split $document \n] {
set OBXSeg $line
set OBXSegGroup [cconcat $OBXSegGroup $OBXSeg \r]
# For displaying in the log
set OBXSegGroupPrint [cconcat $OBXSegGroupPrint $OBXSeg " "]
}
# Create the output file.
set filemsg $line
exec /hci/bin/b64.o -d $document filemsg
puts $output_fh $filemsg
close $output_fh
}
if {![string equal $errorInformation ""]} {
puts "Error Info: $errorInformation"
}
}
}
Thank you for any help or advice you might have.
-Peter