RDLC shows black background PNG image in PDF

moprsalmoprsal Member Posts: 4
Hello,

I have a table with BLOB field. In the BLOB field is store PNG image with transparent background, I use IMPORT function to import an image to the field. I would like to create a report which shows images from the table. Everything goes well, I have a report, I have defined datasource and so on. When I run report from Nav, Preview is showed and it contains images with transparent background. But when I pres "export to PDF", PDF shows black background in images instead of transparent.

In RDLC layout I use object "Image " with Source="Datasource".

Do you have any experiences with export to PDF?

I also tried export image and use it in the report as external source, but the report shows "missing" image (red cross). What doI have to specify regarding this?

Comments

  • moprsalmoprsal Member Posts: 4
    On more thing I'm using Nav 2015 (8.00.40938)
  • SeeSharpSeeSharp Member Posts: 19
    If you try a GIF does it work correctly?
  • moprsalmoprsal Member Posts: 4
    Yes, GIF works correctly. Do you have any idea how to print PNG?
  • SeeSharpSeeSharp Member Posts: 19
    It's most likely that RDLC / PDF doesn't handle RGBA particularly well and ignoring the alpha channel. As this channel approaches 1 the opacity increases allowing for semi-transparency.

    GIFs on the other hand just have a per-pixel color of "Transparent".

    You could convert from PNG to GIF at run-time else use GIF for the reports?
  • moprsalmoprsal Member Posts: 4
    I was afraid of picture conversion. But there is no other way, as you wrote.

    Right now, I dont have any function or SDK to convert PNG to GIF. Do you know how to convert it? Or could you recommend me a SDK/DLL for conversion?
  • SeeSharpSeeSharp Member Posts: 19
    Untested, but you should be able to do it using the `DotNet` variable type:
    Name	DataType	Subtype	Length
    myBitmap	DotNet	System.Drawing.Bitmap.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
    myImageFormat	DotNet	System.Drawing.Imaging.ImageFormat.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
    myColour	DotNet	System.Drawing.Color.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	
    
    
    // Assuming file from filesystem
    myBitmap := myBitmap.Bitmap('M:\y\Transparent.png');
    myBitmap.MakeTransparent(myColour.Transparent);
    myBitmap.Save('M:\y\NewTransparent.gif', myImageFormat.Gif);
    
  • jbellingerjbellinger Member Posts: 2
    I've the same issue. Were you able to resolve?
Sign In or Register to comment.