Skip to content

Is there a way to disable the PDF-handling features? #205

Description

@sungvadan

Hello,

When I upload a PDF to Mindee, I consistently get the following error:

This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)

After looking into the source code, I noticed that GhostScript is available on my server (I can not uninstall it ). However, in the Mindee\Input\LocalInputSource constructor, the SDK calls $this->getPageCount(), which relies on FPDI. Since the free FPDI parser cannot read this PDF, it throws a MindeePdfException.

This exception is not caught because the constructor only catches MindeeUnhandledException:

    public function __construct()
    {
        $this->checkMimeType();
        try {
            DependencyChecker::isGhostscriptAvailable();
            if ($this->isPdf()) {
                $this->pageCount = $this->getPageCount();
            } else {
                $this->pageCount = 1;
            }
        } catch (MindeeUnhandledException) {
            error_log("PDF-handling features not available, page count set to null.");
        }
    }

In my use case, I don't need any PDF-handling features. I simply want to upload the PDF to the Mindee API and retrieve the result.

Would it be possible to disable or bypass the local PDF-handling logic?

If this isn't currently supported, would you consider adding an option in a future release to skip local PDF processing entirely? This would allow users who don't need these features to avoid FPDI-related limitations and upload PDFs directly to the API.

Metadata

Metadata

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions