• Resolved Poiter

    (@poiter)


    Hi,

    Since a couple of weeks the uploaded image of a customer are shown outside the pdf file. I think after an update. My customer needs to print the package slip for the order, but now he can’t see the uploaded image of the customer. So how can I change the max width of the attached image?

    See https://ibb.co/y0m5KWV

    Tried to change some css in my own template, but no result.

    Thank you in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    Hey @poiter,

    This code snippet should make the image’s width be 3cm. Keep in mind that you can adjust the 3cm to a value that you actually want — you can play around with adjusting it. ??

    
    
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_img_width', 10, 2 );
    function wpo_wcpdf_img_width ( $document_type, $document ) {
        ?>
    
        td.header img {
            width: 3cm !important;
        }
    
        <?php
    }
    
    
    • This reply was modified 2 years ago by Darren Peyou. Reason: change name of function
    • This reply was modified 2 years ago by Darren Peyou.

    Hey @poiter,

    just to check-in your status…Were you able to solve your issue with the code snippet above?

    Thread Starter Poiter

    (@poiter)

    Hi Johnny,

    Didn’t received the follow up e-mail, so just I just see it now. Will check asap!

    Thread Starter Poiter

    (@poiter)

    Hi,

    The snippet is for the header image, but I need the uploaded image of a customer to have a maximum width. As shown in my link: https://ibb.co/y0m5KWV

    Plugin Contributor Darren Peyou

    (@dpeyou)

    @poiter,

    I think this will do the trick for a max-with of 3cm:

    
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_img_width', 10, 2 );
    function wpo_wcpdf_img_width ( $document_type, $document ) {
        ?>
    
        .order-details img {
            max-width: 3cm !important;
        }
    
        <?php
    }
    
    • This reply was modified 2 years ago by Darren Peyou. Reason: full PHP + CSS snippet instead of just the CSS part
    Thread Starter Poiter

    (@poiter)

    Hi @dpeyou,

    Thanks that did the trick! Only had to add a margin, because the image was overlayed the top text: https://ibb.co/m0bYBsy

    Thank you very much!

    Gr. Pieter

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Uploaded image from customer too big on the package slip’ is closed to new replies.