Subject:Problem base64 decoding string - base64 string cannot be converted to pdf file Author:Bruce Cantor Date:26 Oct 2023 09:48 AM Originally Posted: 26 Oct 2023 08:43 AM
Hi,
I am having this problem with a base64 encoded string:
When I decode it and save it to disk the resulting pdf file can be opened but all text and images are gone.
My code is like this:
let $pdfFileEncoded := "encodedstring"
let $pdfFileDecoded := ddtek:base64-to-string(xs:base64Binary($pdfFileEncoded), "utf-8")
let $pdfDocRes := if( xps_file:writeAll($pdfOutput_URI,$pdfFileDecoded) ) then $pdfOutput_URI else "error"
I tried to change 'utf-8' to 'iso-8859-1', but that does not make the result better.
Can anybody tell me why I get an incomplete pdf? I can be opened, but it is not good looking.