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

    (@yordansoares)

    Hi @mhds,

    If I understand correctly, you want to remove the page margins, right? If so, you can achieve it passing the following CSS rule through the wpo_wcpdf_custom_styles action hook:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Add custom styles to the PDF documents 
     */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {	
    	if ( $document_type == 'invoice' ) {
    		?>
    		/* Remove page margins */
    		@page {
    			margin-top: 0cm;
    			margin-bottom: 0cm;
    			margin-left: 0cm;
    			margin-right: 0cm;
    		}
    		<?php
    	}
    }, 10, 2 );

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

    Thread Starter Codefix

    (@mhds)

    It worked perfectly thanks.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m glad to hear that, @mhds!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

    Thread Starter Codefix

    (@mhds)

    It’s done, thank you for your support.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thank you, @mhds: You’ve made my day! ?

    Let me know if you need anything else ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Removing the white space around the pdf’ is closed to new replies.