Giter VIP home page Giter VIP logo

magento2-create-custom-pdf-with-given-html-text's Introduction

Magento2 Create custom PDF with given HTML & text

In this blog, we are going to learn how to add a custom PDF in Magento2.

   

In this example we are going to generate PDF which will be having a custom text & HTML rendered in a PDF file.

   

Magento2 Custom module to print & download PDF document with custom HTML & text inside it. As of know we have added this button on details page you can even set the page as per your need on any page after making some basic Magento2 changes in code.

   

Wondering how to achieve that? Don't worry we have got the solution for it.

   

Install our module Binstellar/Productpdf & get the download option on product details page.

Installation Steps

Step 1 : Download the Zip file from Github & Unzip it
Step 2 : Create a directory under app/code/Binstellar/Productpdf
Step 3 : Upload the files & folders from extracted package to app/code/Binstellar/Productpdf
Step 4 : Go to the Magento2 Root directory & run following commands

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -f

php bin/magento cache:flush

   

PDF download link on details page

image1

   
PDF output

image2

   

Note : We have tested this option in Magento ver. 2.4.5-p1

magento2-create-custom-pdf-with-given-html-text's People

Contributors

arjunkanani avatar

Stargazers

 avatar

Watchers

 avatar  avatar

magento2-create-custom-pdf-with-given-html-text's Issues

error was coming

HI I have installed but error was coming

Error: Class 'Dompdf\Dompdf' not found in /home/magento2giftzone/public_html/app/code/Binstellar/Productpdf/Controller/Index/Index.php:80

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.