Welcome Guest, Not a member yet? Register   Sign In
Can't load pdf with using Mpdf in Codeigniter 4
#6

(This post was last modified: 07-12-2020, 02:46 AM by captain-sensible.)

i will have a look over weekend ; it might be something useful for me in providing a pdf download for a blog. This then is just for starters.



i think i found what you are using :https://github.com/mpdf/mpdf


I have edited the post; I have taken a step back to review the issue.

First can we clarify your purpose. You obviously show code that doesn't work ; but is the objective to create a pdf on the fly from say txt or html , or simply that you want to have a download for say a blog.

Quite often on web sites you see a web page and they offer that you can download what you see in as pdf file, so you can read offline. Probably laterally thinking my approach to provide that is going to be produce html ; do a conversion offline to pdf , load that to server with a download link.

Now if you want to produce a pdf using code from say a controller thats something different.  I have used composer but for my local dev i'm not using it. Probably if you just use for Mpdf :
Code:
composer require mpdf/mpdf

that will make life easier. For me this is where i am with it. I'm looking at not just mPDF but also fpdf library and html2pdf library to see ease of use etc.

i got a pdf fairly easily with fpdf but the class has no namespace so i'm going to play with things and come back if i get anywhere.
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply


Messages In This Thread
RE: Can't load pdf with using Mpdf in Codeigniter 4 - by captain-sensible - 07-11-2020, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB