PDF to bitmap on ShapeDiver / request for pymupdf (or alternative)?

Hi @shapediver team,

I’m building a configurator that lets users upload a scanned document as input. The scans come as PDF, which I convert to a bitmap inside a Rhino 8 Python script component using the pymupdf. Locally this works well, but the model gets rejected on upload.

Two questions:

  1. Could pymupdf be reviewed and whitelisted?
  2. Alternatively, is there any other way I can display a pdf in the ImageWidget?

Thanks!

The pymupdf library seems to be very well maintained and therefore it would qualify for deployment to ShapeDiver. However, its licensing is restrictive, because it’s offered either with AGPL or commercial licensing. This means we can’t deploy pymupdf without a commercial license.

Did I understand correctly that your ultimate goal is to display PDFs using App Builder?

@snabela The goal is for users to upload a PDF containing project-specific information. The configurator interface displays this PDF alongside the controls, so the user can adapt the settings while reading it. Keeping it inside the interface avoids switching between windows

Thanks for clarifying this. It seems to me that the best solution would be to add support for rendering PDFs in AppBuilder’ image component. We will include this in one of the next two releases.

Note: Please use our newsfeed to stay up-to-date about releases: https://news.shapediver.com/

That would be perfect. Thanks

It is now possible to display PDFs in the Image Widget of the App Builder since the last release.

Thanks @mathieu1 for the quick update. I use the Import Stream component to upload the PDF, but it doesn’t seem to work correctly. Please see the attached script.

PDF Display.gh (17.2 KB)

You need to switch the Image “Export Options” and use the “PDF Export Options” component instead:

PDF Display_FIXED.gh (10.6 KB)