Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const CornerstoneViewportDownloadForm = ({
}
}, [viewportDimensions, showAnnotations]);

const handleDownload = async (filename: string, fileType: string) => {
const handleDownload = async (baseFilename: string, fileType: string) => {
const divForDownloadViewport = document.querySelector(
`div[data-viewport-uid="${VIEWPORT_ID}"]`
);
Expand All @@ -225,8 +225,9 @@ const CornerstoneViewportDownloadForm = ({
return;
}

const filename = `${baseFilename}.${fileType}`;
const canvas = await html2canvas(divForDownloadViewport as HTMLElement);
downloadUrl(canvas.toDataURL(`image/${fileType}`, 1.0));
downloadUrl(canvas.toDataURL(`image/${fileType}`, 1.0), { filename });
};

const ViewportDownloadFormNew = customizationService.getCustomization(
Expand Down