Posts

Showing posts from May, 2022

PDF VIEW IN BROWSER AND EXPORT AS FILE – PHP

Image
 https://adnan-tech.com/pdf-view-in-browser-and-export-as-file-php/ We are going to use the library named FPDF you can download it from it’s  official site . You will get ZIP file in your download, extract it and you will get just 1 folder. You need to copy that folder in your project root folder where it can be accessible. In that folder you will also find a folder named  “font”  that will be used if you want to add more fonts in your PDF file. By default it came up with 14 fonts at the time of writing this. So we are going to create a simple invoice page which is a common example in E-commerce sites where once you buy any product then an invoice has been generated which contains all the order details. It typically contains company logo, buyer name & address, all products which were added in cart and their quantity & price. Lastly it has total sum of all products, some also have shipping cost so they display grand total which is the sum of all products price and the shipping c