Skip to content

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

Description

@jaroel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions