Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Javascript - Capture Image From Text?

  • 29-07-2011 08:27PM
    #1
    Registered Users, Registered Users 2 Posts: 7,994 ✭✭✭


    Hi Folks,

    This is probably impossible but can this be done in JavaScript.

    I'm looking to build a form. On that form there will be a text input box. What I want to do with that text is capture it as a image, crop to a certain size and then upload in the usual way through PHP.

    Now the problem is some of the text will be superscript and subscript, and everything in between. Is that possible to capture?

    Thanks in advance!

    EDIT:

    Ok, did some digging in the PHP manual and found this: http://www.php.net/manual/en/book.image.php

    And in particular this: http://www.php.net/manual/en/image.examples-png.php

    However, is there any way to edit that script so that I could output for example and equation? Would require a string to interpet the "sub" tags wouldn't it?

    Also, I assume I can take the imagepng($im) output and upload as per usual in a processing file?


Comments

Advertisement