clientIO / clientIO/joint

format.toSVG(): paper background image does not appear in exported png/svg/jpeg file

Open
#1,502 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement jointjs+
Dominant language
JavaScript
Stars
5.4k
Forks
893
Avg merge
3d 3h
Merged PRs (30d)
26

Description

paper.toPNG(function (dataURI) {
      const link = document.createElement("a");
      link.href = dataURI;
      link.setAttribute("download", 'fileName.png');
      document.body.appendChild(link);
      link.click();
    });

The above code is use to export in PNG format, but the paper background image is not applied to the downloaded image

The background image is applied as flows

paper.drawBackground({
        image: 'image url',
        position: 'center',
        repeat: 'no-repeat',
        size: 'cover',
        opacity: 1
      });

Acutal Graph contained
papercontained
Downloaded Image
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the export with paper.drawBackground({ image, position, repeat, size, opacity }) and paper.toPNG(), then compare the behavior of format.toSVG() and the other mentioned export formats. Trace how the background is represented during export; done means the configured paper background image appears in the downloaded PNG, SVG, and JPEG outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.