How to convert a pdf to a picture under web app?

Hi Folks,

when I use Picture.Fromdata( aMemoryBlock) under a desktop app, I get a picture if the memoryblock contains a png, a bmp, a jpeg or a pdf

but under a web app the same method gives me an “unsupportedformatexception” …

I tried a new webpicture( amemoryblock, “filename”)
it gaves me the same exception if the memoryblock contains a pdf.

is there a way to make it work ? I want to display a picture representing the first page of a pdf I upload to the web app from the client browser. it works for png of jpeg but not for pdf.

or should I file a bug or a feature request ?

thanks.

I do that with imagemagick / convert pdf->png

If something works on Desktop and is different on the web, I recommend opening an Issue to make the Web consistent to Desktop.

If think - but don’t know - this is related to system libs. If think loading pdf to into picture is an unsupported und undocumented function. And think that works on macos but not on win (?!). But it was really long time ago I figured that out and there are only some fragments about that coming to my mind

What platform are you running the Desktop app and Web App?

macos on both, but the web clients can be mac or windows

@Ricardo_Cruz do you have any clue(s) why this don’t work ? thanks

Could be a difference between Console and Desktop frameworks. Please open a new Issue so we can take a look :pray:t2:

But as @Marius_Dieter_Noetzel mentioned, you can use a Shell to convert it using ImageMagick in the meantime. That will also offload the processing time to another process.

1 Like

https://tracker.xojo.com/xojoinc/xojo/-/issues/74490

1 Like