Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7546079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:06:22+00:00 2026-05-30T09:06:22+00:00

I have this code where I am trying to read an image from Url:

  • 0

I have this code where I am trying to read an image from Url:

   public class question_insert {
public static String latex(String tex) throws IOException {

    String urltext = "http://chart.apis.google.com/chart?cht=tx&chl="+tex;

    URL url = new URL(urltext);
    BufferedReader in = new BufferedReader(new InputStreamReader(url
            .openStream()));
    String inputLine;

    while ((inputLine = in.readLine()) != null) {
        // Process each line.
        System.out.println(inputLine.toString());

    }
    in.close();

    return inputLine;}

But what I am getting is unreadable code. The url gives only one image try this:

http://chart.apis.google.com/chart?cht=tx&chl=2+2%20\frac{3}{4}

What should I do to embed the image into Html?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:06:23+00:00Added an answer on May 30, 2026 at 9:06 am

    Well, I don’t know if that is what you want because it seems that nobody does. But if you want to get this output

    <img style="-webkit-user-select: none" 
    src="http://chart.apis.google.com/chart?cht=tx&chl=2+2%20\frac{3}{4}" />
    

    you will have to use this code

    public static String latex(String tex) {
        String url = "http://chart.apis.google.com/chart?cht=tx&chl=" + tex;
        return "<img style=\"-webkit-user-select: none\" src=\"" + url + "\"/>";
    }
    

    Also you might have to escape some characters like \ in the tex parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to read in image file from a server , with the code
I have this code in my ASP.NET application written in C# that is trying
I'm extremely new to JS and have this code that I'm trying to tweak.
I am trying to compare two dates. I have this code which I thought
I have this piece of code I'm trying to get to display but no
I have got this code and I am trying to understand the convention followed,
I have this php code, with which I am trying to generate a popup
I am trying to enable mod_deflate. I have Apache 2.0+ and tried this code
All, I am trying to code a Connect4 game. For this, I have created
I am trying to read an image that resides somewhere on the web from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.