Something appears to be lost in the decode process from base-64 to pdf, can someone determine if I am doing this correctly?
Win 2003 Server SP2
CL 5.7 R2
See attachment for inbound message in .msg file.
See attachments for what pdf should look like and what it does look like?
proc code:
package require base64
foreach segment $segments {
if {[cequal [crange $segment 0 2] “OBX”]} {
set obx_fields [split $segment $field_delim]
set list_size [llength $obx_fields]
while { $list_size < 6 } {
lappend obx_fields “”
set list_size [llength $obx_fields]
}
set obx_5_fields [split [lindex $obx_fields 5] $comp_delim]
set list_size [llength $obx_5_fields]
while { $list_size < 5 } {
lappend obx_5_fields “”
set list_size [llength $obx_5_fields]
}
set pdf_data [base64::decode [lindex $obx_5_fields 4]]
break
}
}
set PDFFileName [cconcat $HciProcessesDir “/” $myprocessName “/que_pdf_data/CentralLogic_Test.pdf”]
if { [catch {set outfile [open $PDFFileName w]} cerr] } {
puts [cconcat “–> WARNING: Error Creating ” $PDFFileName ” File – ” $cerr “r”]
} else {
puts $outfile $pdf_data
close $outfile
}