1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Is it posible to click an image and then execute javascript in a pdf document created with...

Discussão em 'Outras Linguagens' iniciado por Claudio Vega, Outubro 7, 2024 às 10:32.

  1. Claudio Vega

    Claudio Vega Guest

    I'm creating a PDF document with Laravel and TCPDF (elibyy/tcpdf-laravel). I want to show/hide a layer when clicking an image. I can do that by clicking on a button because the Button() method has a parameter called $link where I can put javascript code (or a URL). The Image() and Link() methods have the same parameter too but in that case, you can't call javascript (only a URL).

    Button() example (show an alert)

    $pdf_doc->Button('name', $w, $h, '', 'app.alert();'); // works


    Image() example:

    $pdf_doc->Image($image_url, $x, $y, $w, $h, $type, 'app.alert();') // doesn't work


    Is there a workaround to achieve that?

    Continue reading...

Compartilhe esta Página