Read text from rectangular area of a PDF file using PHP - php

I want to read text from given pdf file. I want option, so I can extract text from given box. Somewhere my text is in English and somewhere it is in Hindi.
I am trying to use
How can I do this in PHP?

Related

saving PDFs for later manipulation in PHP

I have a PDF with some text in it that I would like to modify dynamically using PHP. This is being done already with another PDF, and what happens is that PHP simply replaces a token in the form %token% with another value pulled from a database. If you open that PDF in a text editor, you can find the %token% in plain text. But with this other PDF that I want to do the same thing with, if you open it in a text editor, there are no tokens in plaintext (even though I explicitly created one using Adobe Acrobat Pro). Obviously, the PDF's string content in this PDF is either encrypted, compressed, or both. What I want to know is how can I save a PDF so that the string content remains as plaintext such that PHP can manipulate it.
Please note, I do not want to dynamically create the whole PDF from scratch using some PHP library. I know that is something that can be done, but the PDF I am working with already exists and I just want to modify it slightly in the manner described.
For things like that I like to use the free command line tool PDFtk, which can compress / decompress PDFs and some nice thinks more. You may have a look at: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
PS: I edit a special pdf calendar form from the internet. I decompress it and replace the awful pink color for the weekend with gray (Saturday) and blue for Sunday. Violet I use as small bar to mark vacation days.

Text Positioning based on PHP-generated dynamic image file(in a png format)

I have looked everywhere, but I can't find anything.
I am trying to write a PHP script where I can have an image from a URL, and make it as a dynamic .PNG file.
I then want to load it to the client/browser, and allow them to add text, and position it within the image's boundaries. Kind-of like a meme generator,
example:
https://imgflip.com/memegenerator
I plan on having the image be from $_GET if that's needed. I want to be able to save it with the text, and be able to also store the text positioning, etc.
Actually, if I can do this somehow in HTML it will work with what I need!

How to generate texts as image in PDF

I am using dompdf to generate a PDF file. The PDF simply contains texts. I need the content of the PDF to show as an image instead of texts. I do not know where to start. Cannot find anything using Google. Any suggestions?
More info:
In the PDF I currently generated, I can select specific portion of texts by highlighting it using the mouse. In the PDF I should generate, I should not be able to select portion of texts because the texts is already an image. So the PDF I should generate contains an image, and the image contains the texts.
You could generate a png first using phpgd / ImageMagick then shove it through dompdf

PHP Text Extract from Scanned PDF

I need help in Text Extract from Scanned PDF
Is it possible to extract or read the text from a scanned image or an pdf using PHP. If so how it can be done... I am able to read the text from a normal pdf but when it comes to scanned pdf,code is not working.

Read and write rich text files from TinyMCE in php

I am making a file uploader and editer in PHP using the TinyMCE rich text editor.
Which all files/types can be edited in TinyMCE.
Whats best was to edit a server file in TinyMCE.
How do i save to file edited in TinyMCe and what format should i save.
Sample code will be helpful.
In case tinymce is not right editor, please just another open source rich text editor.
TinyMCE is just a WYSIWYG editor which means that it cannot read or write content to files, but it can interpret html to visual texts.
You can exchange html between TinyMCE and you php code then write it as you want into files.
You can use some APIS to convert your files content into HTML to read it, these are some links to read write MS Word Content
How can I display Word documents in a textarea using PHP?
Create Word Document using PHP in Linux
Regards
NiL

Categories