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 8666071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:38:20+00:00 2026-06-12T17:38:20+00:00

I have converted svg to image using Raphael.js , canvg and jquery. But want

  • 0

I have converted svg to image using Raphael.js , canvg and jquery.

But want to make the image at the center of rectangular view port in
svg as well as png. and resize it to particular size like 800*600 etc using chrome.

I am getting the result image that is small and not centered to rectangle.
How can I acheive this. I have jsfiddle setup. Here The fiddle I have compiled.
Also I am getting “ERROR: Element ‘html’ not yet implemented. ” in the fiddle error although I don’t have leading spaces( or I don’t have idea).

I don’t have “ERROR: Element ‘html’ not yet implemented.” error in
local pc.

Thank you very much for your help.

  • 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-06-12T17:38:22+00:00Added an answer on June 12, 2026 at 5:38 pm

    You were trying to create a canvas from a HTML string that contained two elements:

    • The SVG element you wanted to convert
    • The Canvas element you wanted to use to in order convert the SVG into a PNG.

    Canvg doesn’t like having multiple elements to parse, and so complained about “HTML”.

    Have a look at this fiddle forked from yours: http://jsfiddle.net/LVZEX/2/

    All it does is add an extra replace that removes the canvas tag from the end of the HTML string extracted from the map div

          var svg = $('#map').html().replace(/>\s+/g, ">").replace(/\s+</g, "<").replace(/<canvas.+/g,"");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using explode i have converted the string into array , But the array look
i convert a SVG to canvas using canvg to an image and then vb.net
I have created a WFP UserControl with some complex XAML (converted from SVG). It's
i have converted my .caf audio file to NSData object using the following line
I have an place where i upload an SVG file using paperclip, and get
So I am trying to convert the raphael svg I have to the canvas
In my Android application I have created an SVG image converter class. It parses
I'm just learning now the Raphael.js. I have ONE questions: I have an image
I have a C# web application which generates SVG code using RaphaelJS , which
Suppose I've converted a vector image file (.AI/.SVG) to .SWF for ease of importing

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.