drawio icon indicating copy to clipboard operation
drawio copied to clipboard

Retain settings within the "Export As>Advanced" menu

Open floongle opened this issue 2 years ago • 2 comments

  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe. When exporting images using File>Export As>Advanced, the settings are forgotten by diagrams.net. This wastes time and repetition of setting these values results in higher chance of mistakes.

Describe the solution you'd like I'd like the File>Export As>Advanced dialog to remember the settings selected, both within an editing session and (preferably) when a file is reopened.

For example, the "DPI" value and "Transparent" are forgotten every time the user attempts to export. , whereas the "Border" is remembered (but only within an editing session, not when reopening the file).

floongle avatar Feb 22 '23 13:02 floongle

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.

stale[bot] avatar Feb 24 '24 07:02 stale[bot]

Same with the other settings, e.g. "Export As -> PDF".

Usually, I have to repeatedly click: crop, transparent background, download to PC.

If anyone's interested, here's some JavaScript to ease the task a bit:

// Run this from the JavaScript Console.

// File
$(".geMenubar > .geItem:nth-of-type(1)").click()
// File > Export As
$(".geMenubarMenu > .mxPopupMenu > tbody > .mxPopupMenuItem:nth-of-type(16)").dispatchEvent(new Event("pointermove"))
// File > Export As > PDF
var menuItem = $(".geEditor > .mxPopupMenu + .mxPopupMenu > table.mxPopupMenu > tbody > tr.mxPopupMenuItem:nth-child(6)")
menuItem.dispatchEvent(new Event("pointerdown"))
menuItem.dispatchEvent(new Event("pointerup"))

// Selection Only = true
$(".geDialog > div > div > input:nth-of-type(5)").checked = true
// Crop = true
$(".geDialog > div > div > input:nth-of-type(6)").checked = true
// Grid = false
$(".geDialog > div > div > input:nth-of-type(7)").checked = false
// Include a copy of my diagram = true
$(".geDialog > div > div > input:nth-of-type(8)").checked = true
// Transparent Background = true
$(".geDialog > div > div > input:nth-of-type(9)").checked = true
// Export
$(".geDialog > div .geBtn:nth-of-type(2)").click()

// Where: "Download"
$(".geDialog > div > div > div:nth-of-type(4) > select").value = "download"
// OK
$(".geDialog > div > div:nth-of-type(2) .gePrimaryBtn").click()

To make it easy to use, one can probably convert it to a Bookmarklet with jQuery enabled.

YodaEmbedding avatar Mar 11 '24 10:03 YodaEmbedding

Seems a similar issue as https://github.com/jgraph/drawio/issues/2729

yan12125 avatar Sep 05 '24 15:09 yan12125

The advanced export doesn't exist any longer.

davidjgraph avatar Sep 06 '24 21:09 davidjgraph