Is this possible? Because as what I have researched, most are using converters. How can I convert images to PDF using only PHP (Yii 2.0 framework, specifically) without the help of any converter software?
In my web application, user is to fill up a form and attach an image. I would like to convert that attached image to a PDF file.
Anyone might be of help? Thanks in advance.
Edit: I am not sure if a source code is needed here. So if you need it, just let me know.
Related
I need to put hand written signature to pdf.
This pdf is created by dompdf and it works fine.
Open pdf and put signature in pdf is to complicate for workers :)
This must be easy to use.
I find jSignature and I think its perfect for this project.
I didn't know jQuery.
My question is: How can I take signature (svg, png) to variable in php?
I've been looking for a solution to generate PDF from some data I have on a database. Currently I put it on an HTML and then print to PDF, but they asked me to save directly to PDF. These are documents that vary a lot in design, so before it was easy to change a margin or a font size, but now they asking for a direct PDF output it's more difficult, so I saw that LiveDocx is a great solution for me... but these documents are very private (illneses, income...) and my bosses don't want to send any document to a server. So I'm looking for some other solutions. The perfect workaround is doing what LiveDocx proposes (You have a template in a Docx format that you can modify whenever you want, and then you can send some data to the template to fill the gaps and of course save to PDF) but in my own server. Do you know something like this?
My platform is based on PHP+Zend Framework, so it should be compatible with that.
Thank you!!
Well instead of using LiveDocx, i found a really cool Library. mPDF an MIT Licensed library that transfers HTML Code to a pdf document. Its simple and great. Let me know if this helped you and if you need more help.
AND ontop of all that, you can write your data directly to the pdf document. You can input an html file into the pdf writer IF you want. If not then yes you can use their write function to write data directly to pdf.
I am currently building a digital signature system for my company and I need to be able to add the signature once signed to a PDF document.
I have been using FPDF & FDPI to overlay the signature onto the document (this works great if the document is static.)
The problem I have is that the document starts out as a word doc and is converted to PDF. The document has 20 pages and tons of fields passed to it by our case management software so to change to PDF will take me ages also it will change in size based on the information passed from the fields.
I was wondering if anyone has come across a way to search & replace text in a PDF or is there a way to parse the document add a signature and re-create a new PDF.
Any help on this would be great as I have spent a week now trying to find a solution.
Oh sorry for lengthy post just trying to get as much info in as possible.
Thanks
Brad
Actually I'm not aware of any class/library in PHP that is able to replace text in a PDF document with other content. If it is possible to convert the "fields" into real PDF form fields, you may check this out (not free!).
Thanks for your reply
I have managed to sort. I am going to parse the document using parserpdf and then find and replace a placeholder in the document with the signature and then re-build the PDF using FPDF.
Bit long winded but tested and works well.
I have an already pre-designed PDF, and I would like to fill the PDF with some database information. So I'm curious if I should save the PDF into JPG's and render them out with the data on top of the image and re-create a PDF.
Or is there a way to use the PDF already, and print data into the PDF that is already made?
I am trying to figure out the best solution to generating this type of PDF.
All thoughts would be greatly appreciated!
You can read about PHP's PDF library here: http://php.net/manual/book.pdf.php
PHP also recommends these alternatives:
http://www.fpdf.org/
http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf
http://php.net/manual/book.haru.php
PDF files support the use of interactive form fields, so the best method for adding information to a PDF from a database, is add form fields to your database and find a library that let's you fill out PDF forms programatically.
Rendering a PDF to an image just to write information on it and then converting it back to a PDF would mean that no text was selectable in the new PDF unless you OCR'd it, which isn't the most optimal way to do it.
After a bit more digging, I was able to use Zend PDF within the framework to update the PDF quite easily. It was my first time using the Zend Framework, and found it quite useful. I suggest anyone trying to manipulate PDF's use Zend.
Just my .02 though. I appreciate your pointers though that were given.
Long time viewer, first time question asker.
I'm trying to have my personal website parse through my mail box for attachments from a certain subscription list, and then be able to view the PDF attachments as images, preferably jpg.
With the help of this: http://www.linuxscope.net/articles/mailAttachmentsPHP.html
I'm currently using imap_base64() to decode the MIME data and create the PDF. However, I hate using PDF readers in general and I thought it would be a lot more streamlined if I could just view it as an image instead. I've heard for convert with ImageMagick, but would I need to actually write the PDF to a directory before using this, or can I convert somehow directly from the MIME data in the email?
Thanks in advance!
Install and use the Imagick PHP module: http://www.php.net/manual/en/book.imagick.php