{"id":379382,"date":"2023-05-02T13:48:11","date_gmt":"2023-05-02T13:48:11","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=379382"},"modified":"2023-05-04T03:53:29","modified_gmt":"2023-05-04T03:53:29","slug":"how-to-add-custom-footer-in-magento-2-pdf-invoice","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/","title":{"rendered":"How to add custom footer in Magento 2 PDF Invoice"},"content":{"rendered":"\n<p>Invoice plays a major role in e-commerce. An invoice is always sent to your customers for every order. So It is important your invoice has some details of your company, like contact number and address. Therefore, Webkul is writing this blog to add a custom footer to <a href=\"https:\/\/store.webkul.com\/magento2-invoice-pdf-editor.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 PDF invoice.<\/a><\/p>\n\n\n\n<p>First, create the file\u00a0<strong>registration.php<\/strong>\u00a0in the module root directory to register your <a href=\"https:\/\/webkul.com\/blog\/create-hello-module-in-magento2\/\" target=\"_blank\" rel=\"noreferrer noopener\">module<\/a>.<br>File Path: app\/code\/Webkul\/CustomInvoice\/registration.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_CustomInvoice\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    &#039;Webkul_CustomInvoice&#039;,\n    __DIR__\n);<\/pre>\n\n\n\n<p>Now, create an etc folder under the module directory and create module.xml<br>File Path: app\/code\/Webkul\/CustomInvoice\/etc\/module.xml<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_CustomInvoice\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Module\/etc\/module.xsd&quot;&gt;\n    &lt;module name=&quot;Webkul_CustomInvoice&quot;&gt;\n        &lt;sequence&gt;\n            &lt;module name=&quot;Magento_Sales&quot;\/&gt;\n        &lt;\/sequence&gt;\n    &lt;\/module&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>Create di.xml file in the etc folder and define a preference for Magento\\Sales\\Model\\Order\\Pdf\\Invoice.<br>File Path: app\/code\/etc\/di.xml<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_CustomInvoice\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:ObjectManager\/etc\/config.xsd&quot;&gt;\n    &lt;preference for=&quot;Magento\\Sales\\Model\\Order\\Pdf\\Invoice&quot; type=&quot;Webkul\\CustomInvoice\\Model\\Order\\Pdf\\Invoice&quot;\/&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p><br>To add the footer, space is required at the end of the <a href=\"https:\/\/webkul.com\/blog\/magento2-invoice-editor\/\" target=\"_blank\" rel=\"noreferrer noopener\">PDF page<\/a>. For the blank space, We need to inherit \\Magento\\Sales\\Model\\Order\\Pdf\\Invoice in Invoice.php and override drawLineBlocks function. But two private functions are called by drawLineBlocks function. So, we need to override these functions also. At last, create a function for the footer and add it to the <a href=\"https:\/\/store.webkul.com\/magento2-print-catalog.html\" target=\"_blank\" rel=\"noreferrer noopener\">PDF page function<\/a>.<br>Create Invoice.php file to override the Magento\\Sales\\Model\\Order\\Pdf\\Invoice.<br>File Path: app\/code\/Webkul\/CustomInvoice\/Model\/Order\/Pdf\/Invoice.ph<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_CustomInvoice\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n\nnamespace Webkul\\CustomInvoice\\Model\\Order\\Pdf;\n\nclass Invoice extends \\Magento\\Sales\\Model\\Order\\Pdf\\Invoice\n{\n    public function drawLineBlocks(\\Zend_Pdf_Page $page, array $draw, array $pageSettings = &#091;])\n    {\n        $this-&gt;pageSettings = $pageSettings;\n        foreach ($draw as $itemsProp) {\n            if (!isset($itemsProp&#091;&#039;lines&#039;]) || !is_array($itemsProp&#091;&#039;lines&#039;])) {\n                throw new \\Magento\\Framework\\Exception\\LocalizedException(\n                    __(&#039;We don\\&#039;t recognize the draw line data. Please define the &quot;lines&quot; array.&#039;)\n                );\n            }\n            $lines = $itemsProp&#091;&#039;lines&#039;];\n            $height = isset($itemsProp&#091;&#039;height&#039;]) ? $itemsProp&#091;&#039;height&#039;] : 10;\n            if (empty($itemsProp&#091;&#039;shift&#039;])) {\n                $shift = 0;\n                foreach ($lines as $line) {\n                    $maxHeight = 0;\n                    foreach ($line as $column) {\n                        $lineSpacing = !empty($column&#091;&#039;height&#039;]) ? $column&#091;&#039;height&#039;] : $height;\n                        if (!is_array($column&#091;&#039;text&#039;])) {\n                            $column&#091;&#039;text&#039;] = &#091;$column&#091;&#039;text&#039;]];\n                        }\n                        $top = 0;\n                        \/\/\n                        foreach ($column&#091;&#039;text&#039;] as $part) {\n                            $top += $lineSpacing;\n                        }\n\n                        $maxHeight = $top &gt; $maxHeight ? $top : $maxHeight;\n                    }\n                    $shift += $maxHeight;\n                }\n                $itemsProp&#091;&#039;shift&#039;] = $shift;\n            }\n\n            if ($this-&gt;y - $itemsProp&#091;&#039;shift&#039;] &lt; 70) {\n                $page = $this-&gt;newPage($pageSettings);\n            }\n            $this-&gt;correctLines($lines, $page, $height);\n        }\n\n        return $page;\n    }\n\n    private function correctLines($lines, $page, $height) :void\n    {\n        foreach ($lines as $line) {\n            $maxHeight = 0;\n            foreach ($line as $column) {\n                $fontSize = empty($column&#091;&#039;font_size&#039;]) ? 10 : $column&#091;&#039;font_size&#039;];\n                if (!empty($column&#091;&#039;font_file&#039;])) {\n                    $font = \\Zend_Pdf_Font::fontWithPath($column&#091;&#039;font_file&#039;]);\n                    $page-&gt;setFont($font, $fontSize);\n                } else {\n                    $fontStyle = empty($column&#091;&#039;font&#039;]) ? &#039;regular&#039; : $column&#091;&#039;font&#039;];\n                    switch ($fontStyle) {\n                        case &#039;bold&#039;:\n                            $font = $this-&gt;_setFontBold($page, $fontSize);\n                            break;\n                        case &#039;italic&#039;:\n                            $font = $this-&gt;_setFontItalic($page, $fontSize);\n                            break;\n                        default:\n                            $font = $this-&gt;_setFontRegular($page, $fontSize);\n                            break;\n                    }\n                }\n\n                if (!is_array($column&#091;&#039;text&#039;])) {\n                    $column&#091;&#039;text&#039;] = &#091;$column&#091;&#039;text&#039;]];\n                }\n                $top = $this-&gt;correctText($column, $height, $font, $page);\n\n                $maxHeight = $top &gt; $maxHeight ? $top : $maxHeight;\n            }\n            $this-&gt;y -= $maxHeight;\n        }\n    }\n\n    private function correctText($column, $height, $font, $page) :int\n    {\n        $top = 0;\n        $lineSpacing = !empty($column&#091;&#039;height&#039;]) ? $column&#091;&#039;height&#039;] : $height;\n        $fontSize = empty($column&#091;&#039;font_size&#039;]) ? 10 : $column&#091;&#039;font_size&#039;];\n        foreach ($column&#091;&#039;text&#039;] as $part) {\n            if ($this-&gt;y - $lineSpacing &lt; 15) {\n                $page = $this-&gt;newPage($this-&gt;pageSettings);\n            }\n\n            $feed = $column&#091;&#039;feed&#039;];\n            $textAlign = empty($column&#091;&#039;align&#039;]) ? &#039;left&#039; : $column&#091;&#039;align&#039;];\n            $width = empty($column&#091;&#039;width&#039;]) ? 0 : $column&#091;&#039;width&#039;];\n            switch ($textAlign) {\n                case &#039;right&#039;:\n                    if ($width) {\n                        $feed = $this-&gt;getAlignRight($part, $feed, $width, $font, $fontSize);\n                    } else {\n                        $feed = $feed - $this-&gt;widthForStringUsingFontSize($part, $font, $fontSize);\n                    }\n                    break;\n                case &#039;center&#039;:\n                    if ($width) {\n                        $feed = $this-&gt;getAlignCenter($part, $feed, $width, $font, $fontSize);\n                    }\n                    break;\n                default:\n                    break;\n            }\n            $page-&gt;drawText($part, $feed, $this-&gt;y - $top, &#039;UTF-8&#039;);\n            $top += $lineSpacing;\n        }\n        return $top;\n    }\n\n    \/**\n     * Create new page with footer and assign to PDF object\n     *\n     * @param  array $settings\n     * @return \\Zend_Pdf_Page\n     *\/\n    public function newPage(array $settings = &#091;])\n    {\n        \/* Add new table head *\/\n        $page = $this-&gt;_getPdf()-&gt;newPage(\\Zend_Pdf_Page::SIZE_A4);\n        $this-&gt;_getPdf()-&gt;pages&#091;] = $page;\n        $this-&gt;y = 800;\n        if (!empty($settings&#091;&#039;table_header&#039;])) {\n            $this-&gt;_drawHeader($page);\n        }\n        $this-&gt;insertFooter($page);\n        return $page;\n    }\n\n    \/**\n     * Footer for PDF page\n     *\n     * @param object $page\n     * @return void\n     *\/\n    public function insertFooter($page)\n    {\n        $address = &quot;H-28, ARV Park, Sector 63 Road, Noida 201301&quot;;\n        $contact = &quot;Contact Number: +919876543210&quot;;\n        \n        $page-&gt;setFillColor(new \\Zend_Pdf_Color_GrayScale(0.45));\n        $page-&gt;setLineColor(new \\Zend_Pdf_Color_GrayScale(0.45));\n        $page-&gt;drawRectangle(25, 60, 570, 20);\n        $this-&gt;_setFontRegular($page, 10);\n        $page-&gt;setFillColor(new \\Zend_Pdf_Color_GrayScale(1));\n        $page-&gt;drawText($address, $this-&gt;getX($address), 45, &#039;UTF-8&#039;);\n        $page-&gt;drawText($contact, $this-&gt;getX($contact), 30, &#039;UTF-8&#039;);\n        $page-&gt;setFillColor(new \\Zend_Pdf_Color_Rgb(0, 0, 0));\n    }\n\n    \/**\n     * Calculate x coordinate\n     *\n     * @param string $text\n     * @return float|int\n     *\/\n    public function getX($text)\n    {\n        $x = strlen($text)*2;\n        $x = 297-$x;\n        return $x;\n    }\n}<\/pre>\n\n\n\n<p>You have to run given commands from the root directory.<br>1. php bin\/magento setup:upgrade<br>2. php bin\/magento setup:di:compile<br>3. php bin\/magento cache:flush<\/p>\n\n\n\n<p>PDF Invoice get the following appearance:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"724\" height=\"1024\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png\" alt=\"invoice2023-05-02_13-28-05-1\" class=\"wp-image-379455\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png 724w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-212x300.png 212w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-176x249.png 176w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-768x1087.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-1086x1536.png 1086w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-1447x2048.png 1447w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1.png 1653w\" sizes=\"(max-width: 724px) 100vw, 724px\" loading=\"lazy\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Invoice plays a major role in e-commerce. An invoice is always sent to your customers for every order. So It is important your invoice has some details of your company, like contact number and address. Therefore, Webkul is writing this blog to add a custom footer to Magento 2 PDF invoice. First, create the file\u00a0registration.php\u00a0in <a href=\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":454,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14125,2635,2460,2070,14126,590],"class_list":["post-379382","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-custom-footer","tag-invoice","tag-magento-2","tag-magento2","tag-pdf-invoice","tag-webkul"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to add custom footer in Magento 2 PDF Invoice - Webkul Blog<\/title>\n<meta name=\"description\" content=\"To add the footer, space is required at the end of the PDF page. For the blank space, We need to inherit MagentoSalesModelOrderPdfInvoice\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add custom footer in Magento 2 PDF Invoice - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"To add the footer, space is required at the end of the PDF page. For the blank space, We need to inherit MagentoSalesModelOrderPdfInvoice\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-02T13:48:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-04T03:53:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png\" \/>\n<meta name=\"author\" content=\"Samrat Byahut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Samrat Byahut\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\"},\"author\":{\"name\":\"Samrat Byahut\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c8c97e7656d82a6543d34da29e600b6\"},\"headline\":\"How to add custom footer in Magento 2 PDF Invoice\",\"datePublished\":\"2023-05-02T13:48:11+00:00\",\"dateModified\":\"2023-05-04T03:53:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\"},\"wordCount\":253,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png\",\"keywords\":[\"custom footer\",\"invoice\",\"Magento 2\",\"Magento2\",\"PDF invoice\",\"webkul\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\",\"name\":\"How to add custom footer in Magento 2 PDF Invoice - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png\",\"datePublished\":\"2023-05-02T13:48:11+00:00\",\"dateModified\":\"2023-05-04T03:53:29+00:00\",\"description\":\"To add the footer, space is required at the end of the PDF page. For the blank space, We need to inherit Magento\\\\Sales\\\\Model\\\\Order\\\\Pdf\\\\Invoice\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1.png\",\"width\":1653,\"height\":2339,\"caption\":\"invoice2023-05-02_13-28-05-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add custom footer in Magento 2 PDF Invoice\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c8c97e7656d82a6543d34da29e600b6\",\"name\":\"Samrat Byahut\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5a5017a1464388d0df0ac8d7a01d132312af9d3fb8b88ce58e74a21979e3b1f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5a5017a1464388d0df0ac8d7a01d132312af9d3fb8b88ce58e74a21979e3b1f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Samrat Byahut\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/samrat-byahut578\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add custom footer in Magento 2 PDF Invoice - Webkul Blog","description":"To add the footer, space is required at the end of the PDF page. For the blank space, We need to inherit MagentoSalesModelOrderPdfInvoice","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/","og_locale":"en_US","og_type":"article","og_title":"How to add custom footer in Magento 2 PDF Invoice - Webkul Blog","og_description":"To add the footer, space is required at the end of the PDF page. For the blank space, We need to inherit MagentoSalesModelOrderPdfInvoice","og_url":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-05-02T13:48:11+00:00","article_modified_time":"2023-05-04T03:53:29+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png","type":"","width":"","height":""}],"author":"Samrat Byahut","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Samrat Byahut","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/"},"author":{"name":"Samrat Byahut","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c8c97e7656d82a6543d34da29e600b6"},"headline":"How to add custom footer in Magento 2 PDF Invoice","datePublished":"2023-05-02T13:48:11+00:00","dateModified":"2023-05-04T03:53:29+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/"},"wordCount":253,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png","keywords":["custom footer","invoice","Magento 2","Magento2","PDF invoice","webkul"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/","url":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/","name":"How to add custom footer in Magento 2 PDF Invoice - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1-724x1024.png","datePublished":"2023-05-02T13:48:11+00:00","dateModified":"2023-05-04T03:53:29+00:00","description":"To add the footer, space is required at the end of the PDF page. For the blank space, We need to inherit Magento\\Sales\\Model\\Order\\Pdf\\Invoice","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/invoice2023-05-02_13-28-05-1.png","width":1653,"height":2339,"caption":"invoice2023-05-02_13-28-05-1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-add-custom-footer-in-magento-2-pdf-invoice\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add custom footer in Magento 2 PDF Invoice"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c8c97e7656d82a6543d34da29e600b6","name":"Samrat Byahut","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5a5017a1464388d0df0ac8d7a01d132312af9d3fb8b88ce58e74a21979e3b1f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5a5017a1464388d0df0ac8d7a01d132312af9d3fb8b88ce58e74a21979e3b1f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Samrat Byahut"},"url":"https:\/\/webkul.com\/blog\/author\/samrat-byahut578\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/379382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/454"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=379382"}],"version-history":[{"count":12,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/379382\/revisions"}],"predecessor-version":[{"id":379696,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/379382\/revisions\/379696"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=379382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=379382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=379382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}