Skip to content
This repository was archived by the owner on Mar 6, 2019. It is now read-only.
This repository was archived by the owner on Mar 6, 2019. It is now read-only.

repurpose for use beyond a bookmarklet #19

@deanmalmgren

Description

@deanmalmgren

Thanks for putting this together @shancarter et al!

I recently had a project where I wanted to have a button that downloaded an svg image as a png and, when combined with a few things from this blog post, I made it possible to download an svg with the click of a button (highlighted below):

screenshot

I was thinking of contributing this back to the project so that others could easily download svg elements as a png with an interface that looks something like this:

<!-- index.html -->
<script src="//cdn.rawgit.com/NYTimes/svg-crowbar/gh-pages/svg-crowbar-download.js"></script>
<script>
    var svg_el = document.getElementById("#my-svg");
    $("#my-button").click(function () {
        crowbar(svg_el, { // optional arguments
            filename: "awesome.png",
            width: 400,
            height: 400,
        });
    });
</script>

I would be happy to put together a pull request but, before I did, I thought I'd try and see if this is inline with the goals of this project or whether it would be better to just start a separate project that enables this functionality. Would you like this functionality to be baked into svg-crowbar or is your focus specifically on the bookmarklet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions