• Resolved phalancs

    (@phalancs)


    When using a SVG, there is a sizing issue. As you need a very high height to make them work. Unfortunately, width grows proportionally with the height, which results in the area for the logo being huge and pushing aside the contact data in the header.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @phalancs,

    Although the PDF engine we use, dompdf, has limited supports SVGs, it often produces issue with complex vector images.

    In your case, my recommendation is to convert your SVG image into JPG or PNG, that is a safer and more compatible way to work with images in combination with this PDF engine.

    Thread Starter phalancs

    (@phalancs)

    The SVG support is fine. It is just the sizing that causes problems. Switching to bitmap files is not a valid solution for me as SVG is far superior for a PDF and actually working. It would just a need a little tweaking ??

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for providing more details, @phalancs.

    After a second reading of your first message, I’m understanding that you want to increase only the height of your shop logo, right?

    /**
     * PDF Invoices & Packing Slip for WooCommerce:
     * Add custom styles to the PDF documents 
     */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
        ?>
        td.header img {
        	width: 3cm;
    	height: 3cm;
        }
        <?php
    }, 10, 2 );

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SVG as Logo: Sizing Problem’ is closed to new replies.