Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portal_transform api return error message instead of raising error when coverting pdf to plain text #21

Open
jaroel opened this issue Sep 23, 2017 · 0 comments

Comments

@jaroel
Copy link
Member

jaroel commented Sep 23, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant