HI-dpi enabled & DynaPDF problem with png's

  1. 3 months ago

    I'm using 2018r3 and DynaPDF Plugin MBS_DynaPDF_dynapdf3_Plugin_18844 (released at the end of 2015)

    logo is a png image added to the project's contents via right click (Image).

    Without having Hi-DPI enabled this works:

    Dim imgLogo as Picture = logo
    Dim imgLogoWidth As Integer = 140
    Dim imgLogoHeight As Integer = 49
    call pdf.SetTransparentColor pdf.RGB(0,0,0)
    call pdf.InsertPicture(imgLogo, imgLogo.mask, 560.0 - imgLogoWidth, 40, imgLogoWidth, imgLogoHeight)

    When I enable Hi-DPI I'll get a NIL exception related to the mask missing. I don't understand why this happens.

    I don't think that this is a DynaPDF bug. It rather looks like XOJO Images are handled in a different way when Hi-DPI...I really have no clue how to investigate further right now...as I'm not sure if this is a XOJO bug, or whether I don't understand how to do these things right...

    Also in the current DynaPDF examples, like

    • Create PDF with Picture and Mask
    • Create PDF with Picture
    • Create PDF with Picture file
    • Create PDF with Picture with transparency

    I could not figure out a way to include a PNG.

  2. Dave S

    Feb 2 San Diego, California USA

    Are you putting the image into an Xojo ImageSet? or is this an older version of Xojo?

    An ImageSet can hold multiple resolutions of the same image, and Xojo will present the most appropriate version as required

  3. Edited 3 months ago

    Yes the png is inside an image set ("@1x", "@2x", "@3x").

  4. Edited 3 months ago

    I narrowed it down a little bit. Also jpeg's do not work. Here are the steps to reproduce the problem:

    1. Open the DynaPDF example: Create PDF with Picture

    2. Shared Build Settings -> Supports Hi-DPI -> On

    3. Drag & Drop a jpeg into the project contents and change the name to "img_logo". This automatically creates an image set, if Hi-DPI is enabled.

    4. Now change line 17 of the app's Open Event from

    dim p as Picture = LogoMBS(500)


    dim p as Picture = img_logo

    5. Run the program. The PDF will be blank.

    Also "dim p as Picture = img_logo.IndexedImage(0)" does not work.

    "img_logo.ImageCount" is always 0

    So basically it seems to be impossible to include jpeg's and png's into a project, and insert those into a PDF via DynaPDF, when Hi-DPI support is enabled.

or Sign Up to reply!