embed svg file in html

Discussion in 'Ruby' started by dukeenggitster@gmail.com, Dec 14, 2009.

  1. Guest

    In my rails application view i am using a svg file.I have a
    static .svg file and then embed it in a html file.

    <html>
    <head>
    <h2>Level 2 GSmart Report</h2>
    </head>
    <body>
    <div>
    <embed type="image/svg+xml" src="report.svg"
    width='100%' height='100%' />
    </div>
    </body>
    </html>

    in controller i render the html file.

    render :file =>'C:/instantrails/rails_app/ALUgsm/app/views/alu_gsm/
    report.html'


    It is showing the html but not svg content.
    Can anybody help me,what to do?
    , Dec 14, 2009
    #1
    1. Advertising

  2. Your first action should be to google for "embed SVG HTML".

    After that, I suggest:

    (1) Reproduce your problem using entirely static HTML files, which you
    access using URLs like file:///temp/whatever.html

    This takes Rails out of the equation altogether, so you can ask your
    question on a HTML or web design mailing list if the embedding doesn't
    work.

    (2) If you can make it work with the static pages but not with Rails,
    you can ask the question again on a Rails mailing list. Post your
    relevant bits of server logs, so you can show whether the embed tag is
    attempting to fetch the svg, and if so, whether it's succeeding or not.

    Remember that you have a relative URL in your HTML, i.e.
    src="report.svg", so the browser will probably be fetching
    /some_controller/report.svg. Is that what you were expecting, and is
    your application serving it?

    (3) Rails happens to be written in Ruby. That's is a long way from your
    problem area, so asking the question here on a Ruby programming language
    mailing list is inconsiderate at best.

    For more advice, see
    http://www.catb.org/~esr/faqs/smart-questions.html#intro
    --
    Posted via http://www.ruby-forum.com/.
    Brian Candler, Dec 14, 2009
    #2
    1. Advertising

  3. schrieb:

    >In my rails application view i am using a svg file.I have a
    >static .svg file and then embed it in a html file.
    >
    > <html>
    > <head>
    > <h2>Level 2 GSmart Report</h2>
    > </head>
    > <body>
    > <div>
    > <embed type="image/svg+xml" src="report.svg"
    >width='100%' height='100%' />
    > </div>
    > </body>
    > </html>
    >
    >in controller i render the html file.
    >
    > render :file =>'C:/instantrails/rails_app/ALUgsm/app/views/alu_gsm/
    >report.html'
    >
    >
    >It is showing the html but not svg content.
    >Can anybody help me,what to do?
    >
    >

    Congratulation!

    The Jeszra documentation and Gestalitems use lots of svgs:
    See http://jeszra.sourceforge.net/jeszra/index.html
    http://jeszra.sourceforge.net/pages/index.htm
    http://gestaltitems.sourceforge.net

    If you don't see any svg, then your browser is the culprit.
    Camino 2.0 for example does not show html embedded svgs...
    bug in the browser.


    If you see them:
    <object data="pictures/packfiltered01.svg" type="image/svg+xml"/>

    -roger
    Arndt Roger Schneider, Dec 14, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    501
    Arne Nordmann
    Jun 28, 2004
  2. Mardagg
    Replies:
    0
    Views:
    788
    Mardagg
    May 12, 2006
  3. Mardagg
    Replies:
    0
    Views:
    637
    Mardagg
    May 12, 2006
  4. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    800
    Roland de Ruiter
    Aug 18, 2006
  5. Helmut Jarausch

    Re: svg-chart 1.1 SVG Charting Library

    Helmut Jarausch, May 20, 2008, in forum: Python
    Replies:
    0
    Views:
    460
    Helmut Jarausch
    May 20, 2008
Loading...

Share This Page