Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Javascript - Capture Image From Text?

  • 29-07-2011 09: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