The returned object of response.document_translation.byte_stream_outputs
is <class 'proto.marshal.collections.repeated.Repeated'>
which means it is a list. You need to loop through the bytes_stream
object then write it to file.
See code snippet below for the implementation:
bytes_stream = response.document_translation.byte_stream_outputs
f = open('2_after.pdf', 'wb')
for data in bytes_stream:
f.write(data)
f.close()