we are saving a docx and pdf files in contentversion. But having issue in decoding it back. Blob.tostring doesnt work as the files encoding is not in the UTF-8 formatting.

Can you please help me reading contentversion ->versiondate (not in UTF-8) formatting.



DOCX and PDF are not "encoded" at all--they are binary data formats. You won't be able to easily read these files formats without implementing relevant file readers. DOCX requires a ZIP depression algorithm, while PDF would need to be able to read the PDF format, which is a pretty complicated file format. You won't be able to do anything significant with these kinds of files in Apex.

Not the answer you're looking for? Browse other questions tagged or ask your own question.