mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add optional watermark on export (#1365)
* Add optional watermark on export * Address init PR feedback * Add SVG export with refactoring * Update export.ts * Move addWatermark to appState * Update snapshots * Fit watermark in small scene * Rename watermark things Co-authored-by: Lipis <lipiridis@gmail.com>
This commit is contained in:
parent
13cea081f3
commit
5822117e23
11 changed files with 349 additions and 9 deletions
|
@ -294,12 +294,14 @@ export async function exportCanvas(
|
|||
viewBackgroundColor,
|
||||
name,
|
||||
scale = 1,
|
||||
shouldAddWatermark,
|
||||
}: {
|
||||
exportBackground: boolean;
|
||||
exportPadding?: number;
|
||||
viewBackgroundColor: string;
|
||||
name: string;
|
||||
scale?: number;
|
||||
shouldAddWatermark: boolean;
|
||||
},
|
||||
) {
|
||||
if (elements.length === 0) {
|
||||
|
@ -310,6 +312,7 @@ export async function exportCanvas(
|
|||
exportBackground,
|
||||
viewBackgroundColor,
|
||||
exportPadding,
|
||||
shouldAddWatermark,
|
||||
});
|
||||
if (type === "svg") {
|
||||
await fileSave(new Blob([tempSvg.outerHTML], { type: "image/svg+xml" }), {
|
||||
|
@ -327,6 +330,7 @@ export async function exportCanvas(
|
|||
viewBackgroundColor,
|
||||
exportPadding,
|
||||
scale,
|
||||
shouldAddWatermark,
|
||||
});
|
||||
tempCanvas.style.display = "none";
|
||||
document.body.appendChild(tempCanvas);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue