How to make a PDF file read - only using PHP? - php

I want to create a PDF so that the user can only read it but not edit it. How i can do this with PHP or some lib for PHP. Now i using PDFtk, but I can't do to change the editing I was shown Russian letters in PDF form.

for you to be able to create a pdf file u need to download fpdf in the particular folder you are working with
check this link out, it will help you on how to go about it
https://youtu.be/0KiqCSy0jHA
if it helps let me know

Related

dynamic pdf Implementation in CodeIgniter

I have added blank pdf file in my ci project and wants to edit it dynamically.
I mean I have created some blank text fields in my pdf and wants to fill the value with ci code. please answer me is this possible or not.
Thanks.
Rather than editing an existing PDF you should use a PHP/PDF generator that creates a PDF from scratch and uses your supplied data in the PDF that gets created.
There are lots of open source libraries out there that can do this for you. Just search 'PHP PDF' but here is an example of one I've used with great success and it's easy to use:
https://github.com/dompdf/dompdf

how to create and download pdf file using php?

I am doing a project in which I have to get the data from a form and assemble them and download them as a pdf file.
Getting the data part is over.
I am not able to assemble the data and download it as a pdf file.
Please help me.
And it would be helpful if I can get the codes.
You can use DOMPDF, which is a HTML to PDF convetor or wkhtmltopdf extention

is it possible to pass a file uploaded using php to a javascript as input?

Im working on a tile based tmx editor and currently have file saving working. Currently it passes the tmx to a php file called endpoint that downloads the file. it can be viewed here www.jamesplanet.net/growtopiamapeditor/beta.
What I need to know is it possible to use php to upload a file then pass the file to javascript to load into the editor?
If you need a copy of the source I can put a link
If this question isn't worded correctly or hasn't enough information please don't down vote. instead let me know what else you need to know.
Basically this need to work , you have to use iframe , which you can create on the fly and use it as posted back to php code. This is one of the common way to achieve this. There will so many third party using this concept
Possible solution: You could have the PHP script download the file, insert the file details into a table and only return a name and/or id of how to get the file details from the table in JSON format for the javascript to add the file to the list.

How can i generate PDF with live editing (Instant edit) and PHP/Ajax

i will programming a tool that can generating a PDF.
i´ve generated PDF´s with FPDF with static data´s in the past.
And now i will that the pdf will be generated by live editing.
e.g: the user can look the finaly pdf page and click on the law fields to type the text.
has anyone ideas?
Thanks !
It is not possible to directly edit PDF file in your browser. All you can do is just get input from user and generate PDF file based on it using fpdf(better use tfpdf for utf support) on your server.
How about you use a tool like TinyMce to edit your data ,grab the output html and create a PDF out of it using MPDF or html2pdf

Php:Creating PDF file

I'm wondering is this is possible or not?
Suppose i have div containing 10 Questions,Options and Answers.
Now,if user want to copy content of that div he has to manually select and copy the content using mouse and paste on his editor(Ms Word or some other editors).
But what i want is when user clicks the download button the content gets copied to the pdf(or other file) file and can be downloaded.
You need to use fpdf for that
Here's a nice tutorial of how to create a pdf file using PHP
Reference
FPDF is probably the best library to create PDF's in PHP
Check out fpdf website here :
http://www.fpdf.org/
Best for
Multiple layers of text/images
Watermarks
Barcodes much more
Do check out the Scripts section in the website
Great PDF lib for creating PFDs is mpdf just try example, you would be amazed how easy it is: http://www.mpdf1.com/
i think, you need fpdf lib.
to create txto other similiar file from the content of the page:
open/create file
read_page = read the page content
file_put_content(read_page)
file is ready to download

Categories