Support » Fixing WordPress » insert image

  • Hi Gurus,

    I have a problem with inserting image into my pdf generator with desired size.
    As a first I get image by:

    $image = wp_get_attachment_image($first, 'full' );

    when I echo to an empty table with 1 row and 1 column:
    echo $image;
    image is inserted correctly and fits the whole page.

    When I create 3 columns and I span them image takes original size.

    How the syntax to insert image to fit full td width should looks like?
    I have tried:

    echo <td colspan="3" style="width:2435px;float:center;">; without luck.

    My table definition and columns above use width:30% but it has no impact, size is always the same and I cannot find a method to insert image to fit full width of tables across 3 columns.


    • This topic was modified 10 months, 1 week ago by  lechur.
Viewing 1 replies (of 1 total)
  • Moderator Marius L. J.



    So without seeing what’s happening, or knowing your code, I would presume that your PDF generator is taking the size of tables and applying the base width to the image.

    What you could try, is passing a style attribute to the wp_get_attachment_image() function (the 4th argument can be an array of attributes) that define a width: 100%; on the image it self, this should (in theory) give your generator the data it needs to work with.

Viewing 1 replies (of 1 total)
  • The topic ‘insert image’ is closed to new replies.