I am trying to figure out why, when we decode a pdf sent embedded into HL7 OBX segments, about 2 percent of the time we end up with blank pages in the pdf. The mysterious thing is that when the same message is replayed, the PDF gets built perfectly. The only wildcard in the process (that I can see) is the base64 decoding. If it were a message based problem, it would seem like it should be consistent every time the message is played through.
Key logic from tclproc:
# encodedData is the encoded pdf stitched together from multiple OBX’s
set base64DecodeFile [::base64::decode $encodedData]
set pdfFileHandle [open $pdfFilePath w]
puts $pdfFileHandle $base64DecodeFile
close $pdfFileHandle
The pdf file created is not EMPTY – it’s there – it just opens up as a PDF with several blank pages. Ex:
%PDF-1.6^M%âã