document is a complex type while the string is a simple data type.
While coercing document to string, the document's content will be converted into base64 encoded string and will be assigned to the string variable.
You can try any of these options:
Option 1: You could write a custom component to decode the base64 string
Option 2: save the document content to a temporary file and read the file content as string (Using readString activity).
Hope that may help you.
Nith