I want to easily create a simple PDF file with some text in it. Ideally, I would like to be able to use the php function: file_put_contents(). So, in a perfect world something like this would make my day:
create_pdf($location, $text);
So I could call it:
create_pdf("/var/temp.pdf", "hello world").
This would create a PDF at /var/temp.pdf with the words "hello world" in it. Without getting an overcomplicated class or library to create PDFs, is there perhaps a simple way to generate a PDF like this using pure PHP?
I don't want to use a libary, so perhaps there is a way to get a PDF base 64 encoded and use it like that, just altering the bits where I want the text to change?