I have a problem saving a pdf file using HTTP activity.
I can save a file, but when I try to open it, it shows an error message.
Out IT told me, that the downloaded file is base64 encoded - so that I have to decode it to UTF-8.
I was able to extract the DocumentContent from the HTTP Response.
Then I try to decode it with:
System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(strDokumentContent))
I’m getting a string that seems to be well decoded to UTF-8.
Using “Write Text File” I’m able to save this String as a PDF - but I’m unable to open it.
I’m not saving the pdf, then reading it again and trying to decode it afterwards.
I’m using the HTTP Requests - response. Than I’m using Deserialize JSON. Afterwardt I’m trying to get the Dokument Content through: cStr(jsonDeserialized.GetValue(“dokumentContent”))
There I get the base64 String of the content
I’ve tried to use the Word activities, but it didn’t work.
There I’ve tried ro append the String to a Word Document and then Extract it as PDF.
But it was just the UTF-8 Text, like one can senn in the editor.
Maybe I was using it the wrong way?
Thank you a lot for this suggestion.
When I’m using this option, I’m not able to decode the file from base64 to UTF-8 before opening it.
So when I open the file it shows me the error: could not open “” because it is either not a supported file type or because the file has been damaged.
do I have to enter the codintype of the source format, or the one from the format to be?
Can’t convert it there - just insert the current encoding format - isn’t it?
Thank you so much for your patience!
Is it even possible to recieve pdfs that contain pictures with this method?
from your screenshot we got the hint that file is encoded to Windows-1252 so we will use this for the first step. Kindly note: we already shared some additional information on it with you