MBS DynaPDF Plugin - PNG Problem

I have a problem with PNGs in Dyna PDF Plugin:

I’m using this code:

  URL_Ansicht1 = "url/Artikel_4010000029_900_1_klein.png"
  Dim socket As New HTTPSocket
  Dim data As String = socket.Get(URL_Ansicht1, 0) ' using synchronous GET
  If socket.HTTPStatusCode = 200 Then ' OK
    ' Picture.FromData creates a new picture from raw binary data
    Dim p1 As Picture = Picture.FromData(data)
    If p1 <> Nil Then
        call pdf.InsertPicture(p1, 30, 30, 50, 50)
       MsgBox("Not a picture.")
    End If
  Else ' errors, redirects, etc.
     MsgBox("HTTP Status: " + Str(socket.HTTPStatusCode))
  End If

When I test it, I can’t see the picture. I tried everything. Until I found a “solution”:
I convert the PNG to JPG with the Apple Automator. Then I change the line
URL_Ansicht1 = “url/Artikel_4010000029_900_1_klein.png”
URL_Ansicht1 = “url/Artikel_4010000029_900_1_klein.jpg”

And it works!
So the MBS Dyna PDF Plugin have an issue with .png?

My problem is, that I can’t change the png to jpg format, because they are on a web server which can’t change to jpg. So I have to use the PNGs.

To test it, I uploaded the .png and the .jpg to this URL: http://we.tl/angrf9b4hr

No png should work.
And I would highly recommend not opening the picture first, but use InsertImageFromBuffer and pass the data string directly to the plugin.

But I only change .jpg to .png - and it isn’t working.
With the .jpg it works.

Hmm. :frowning:

you use pIcture.Open here and if picture.open doesn’t work for PNG, that’s not my fault.

I mean Picture.FromData.