From @nngu6036 on August 1, 2017 6:6
try:
transforms = getToolByName(context, 'portal_transforms')
stream = transforms.convertTo(
'text/plain',
output_data,
mimetype='application/pdf')
if stream:
text = stream.getData()
except:
return ''
For some PDF, the return values is "Syntax Error: Expected the optional content group list, but wasn’t able to find it, or it isn’t an Array Permission Error: Copying of text from this document is not allowed.“,
Copied from original issue: plone/plone.api#378
From @nngu6036 on August 1, 2017 6:6
For some PDF, the return values is "Syntax Error: Expected the optional content group list, but wasn’t able to find it, or it isn’t an Array Permission Error: Copying of text from this document is not allowed.“,
Copied from original issue: plone/plone.api#378