Write PDF/TIF from embedded HL7

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Write PDF/TIF from embedded HL7

  • Creator
    Topic
  • #55456
    Jason Puskar
    Participant

      Hello,

    Viewing 1 reply thread
    • Author
      Replies
      • #85395
        Jeff Anderson
        Participant

          Your issue may be when you are writing the PDF file from the encoded you are adding new lines to the file and corrupting it. You have to use the “-nonewline” when writing to the file. Assuming you are base64 encoding the file here is a code snippet for decoding:

          ==================================

          package require base64

          set handle [open $pdfFile r]

          fconfigure $handle -encoding binary -translation binary

          set pdfData [read $handle]

          close $handle

          set outPDF [ base64::decode $pdfData ]

          set handle [open $pdfFile.DECODED.PDF w]

          fconfigure $handle -encoding binary -translation binary

          puts -nonewline $handle $outPDF

          close $handle

        • #85396
          Jason Puskar
          Participant

            Jeff,

               Thanks!  I took your suggestions and applied to my script.  I was able to create the files from embedded PDF’s from the OBX|5 segment(s).

            Jay

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.