Jump to content

Recommended Posts

Posted

Hello

I'm use to copy past svg code on sublim with Mac from AD or AP

I have set Preference/general/ copy as svg text

It work very wel on mac but now I try on a Windows and it don't work ! 

I don't find any solution on forum and I hope that there is one !!!

Thank you

Posted

What evidence leads you to believe it doesn't work on Windows, @C3D?

If I enable that option, copy something in Designer, and then examine the clipboard contents with a clipboard viewer I see an SVG version of the object I copied is available. With the option off, no SVG version is available in the clipboard.

You can also copy something, then in Designer or Photo you can do a Edit > Paste Special, and you'll see an SVG version is available if you have the option enabled and the object supports it.

Perhaps you're trying to copy something that doesn't support that option?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted

Thank you for answer

I use this every day on mac it work

It's the first time I try the same on window, nothing to copy even with a simple rectangle svg.

I don't have a clipboard viewer but the option is "on" on my window10 setting

Posted
8 minutes ago, C3D said:

nothing to copy even with a simple rectangle svg.

Sorry; I'm not sure what you mean there.

What are you copying from, and what are you trying to paste into? Have you tried using Edit > Paste Special in Designer or Photo to show that there is SVG data in the clipboard?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted

Yes if I use  Edit > Paste Special in Designer, I paste the svg. So there is well something in the clipboard.

But if I want to paste in text editor (sublim or notepad)  : nothing

Posted
27 minutes ago, C3D said:

Yes if I use  Edit > Paste Special in Designer, I paste the svg. So there is well something in the clipboard.
But if I want to paste in text editor (sublim or notepad)  : nothing

a workaround:
needed:  Editor (e.g. Notepad++* etc.)  and "InsideClipboard" **

  1. copy the Object in Designer
  2. open InsideClipboard or click on refresh if its already open.
  3.  find the line which says "Scalable Vector Graphics" in column "Format Name"
  4.  click that line once, the contents of this section will be displayed below.
  5.  select all (CTRL-A) and copy that (CTRL-C)
  6. paste the XML into your favorite Editor.

image.png.22ef9c285b22339f82047b15279bdd86.png

image.png.447b055f38d5e7d5045874adf1cd0f76.png

*    https://notepad-plus-plus.org/
**  https://www.nirsoft.net/utils/inside_clipboard.html

kind regards
Fritz

Posted

Ok this work... I'm disapointed that it dont work directly like I'm used to on my Mac ...? A little idea of the reason why a direct copy /paste don't work ?

Thank you for this alternative solution, it's always better that save as svg and reopen svg file ... 

Posted

@C3D  

Quote

A little idea of the reason why a direct copy /paste don't work ?

guess that is because the Clipboard contains far more Data than just the XML.
If you check my Screenshot above, there are 8 components (parts?) and almost all of them are bigger ("Size") than the XML  (OK, the SVG contained just a square...)

Perhaps a developer from Serif can explain briefly, how the Clipboard of Windows-Operating-System is handled and why it contains so much extra-Data... 
Thanks in Advance.

Fritz

Posted

When I copy a rectangle in Designer, while the Preference to copy items as SVG is enabled, my clipboard has the following contents:

image.png.a16ded1d1f7749149673adcb7ca91e36.png

Windows applications have a choice of what kind of data they will accept, and what kinds of data they will paster from the clipboard.

Both the image/x-inkscape-svg and Scalable Vector Graphics versions contain the xml text, but the text editor you're pasting into needs to be coded to accept one of those formats.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted
9 hours ago, Lagarto said:

This seems to have been discussed already back in 2016, so over three years ago, and it seems there is no development. From this thread it appears that on macOS the option really puts the SVG object on the Clipboard as text (an XML tag). But I cannot check whether on macOS items are always also placed as SVG graphic objects, and the option only has the effect of placing the object on the Clipboard ALSO as a text object.

Good find, though I'll point out that mostly that discussion has been about it not working on Mac. Also, the first page of the discussion is from 2016 and 2017, but the later part of it is from January, 2019.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted
11 hours ago, Lagarto said:

Interestingly, on Windows the option is named "Copy Items as SVG" (rather than "Copy as svg text", as quoted by OP -- I do not have macOS version of Affinity apps so I cannot check this) ...

In the U.S. English Mac versions it is also named "Copy Items as SVG," so no difference in that respect.

11 hours ago, Lagarto said:

On macOS I understand the option completely: there the Publisher/Designer item is probably copied onto the Clipboard both as SVG (graphic object) and -- optionally --- as text (an xml tag).

I can't claim to understand it completely but in the macOS below are the clipboard contents with & without the "Copy Items as SVG" option enabled with a single rectangle object copied:

1794423683_clipboardviewer.jpg.3e63c1f60710ff484bc02acecbd2f78d.jpg

Several of the types like the PDF & PNG ones are duplicates of each other. Only with the option enabled is there a 'plain-text' type, but it is empty. The two TIFF types are empty with it disabled, populated if it is enabled.

Anyway, the bottom line is in the macOS among other things "Copy Items as SVG" does place on the clipboard an SVG object formatted as text in an XML wrapper. EDIT: Actually, on closer inspection, the XML wrapper just includes a reference to the SVG object. The object itself is stored in a subfolder in /var/folders/ as "Clipboard.svg."

Like @walt.farrell mentioned above for Windows, in the macOS what gets pasted into another app depends on what type(s) of data they will accept, so that has to be taken into account.

All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Posted
45 minutes ago, walt.farrell said:

Good find, though I'll point out that mostly that discussion has been about it not working on Mac. Also, the first page of the discussion is from 2016 and 2017, but the later part of it is from January, 2019.

DUH! If I had just reread that discussion before I posted to this one my previous post would have been much shorter & to the point, plus I would not have had to edit it.

Anyway, I think for both Mac & Windows, it all comes down to what what types of data apps will accept from the clipboard, just like Walt said earlier in this discussion, & what they do with that data.

I am certain  of one thing only: this is much more complicated than it seems. The clipboard usually contains several different types of data. Some of them may just be pointers to data stored somewhere else. An app may accept several different types & use them in combination with a local app context to determine what (if anything) gets pasted. The OS may enforce security restrictions that limit what kind of data an app can see or pass to the clipboard. Third party additions that directly or indirectly affect clipboard contents, where they are stored, or how they are referenced may cause unexpected behavior, as might things like Apple's "universal clipboard" that works across multiple devices.

All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Posted
29 minutes ago, Lagarto said:

I compiled now ClipboardViewer v4.0 by Apple, and could confirm that Affinity apps indeed copy SVG data as UTF-8 string on the Clipboard, when "Copy Items as SVG" is checked.

Yeah, that is yet another thing I botched in my first post. Where I said the 2 clipboard data types with arrows pointing to them contain SVG data as text, I should have said that about the public.utf8-plain-text item instead.

I blame it all on not ingesting enough coffee before posting! 🤪

All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Posted
16 minutes ago, Lagarto said:

What is crucial in the screenshot you had taken is the line "public.utf-8-plain-text", that shows when the "Copy SVG" option is turned on. It is just that the earlier Clipboard Viewers seem to be buggy in this respect as they do not show the actual content (it appears to be empty, but is not).

You are all too right about that. The old version 2.0 Clipboard Viewer I still use is indeed buggy -- it always shows the content immediately after anything is copied to the clipboard (& if needed I hit the Reload button), but after that it is completely flakey, particularly for plain-text & maybe a few other data types.

The thing is, I know this, but sometimes I forget to recopy whatever I am checking to the clipboard. Just another of my many dumb mistakes.

All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Posted
5 hours ago, Lagarto said:

It seems it is not related to a bug in the Clipboard Viewer, after all. I had another look on this and it seems that the plain-text format SVG code placed on the Clipboard by Affinity apps really "expires" within a fairly short time ...

That is consistent with what I see with Clipboard Viewer, 2.0, but even if I wait several minutes, as long as I don't copy anything else to the clipboard, TextEdit (among other apps) pastes the plain text version into a new or existing document in that app for as long as Affinity Designer is running on my Mac, including after I close the document in ADHowever, if I quit Affinity Designer, that won't work -- the paste command in TextEdit is greyed out, Finder > Edit > Show Clipboard says "Clipboard contents: None," etc.

Moreover, this happens whether or not "Copy Items as SVG" is checked & regardless of what kind of data I copy to the clipboard in AD. This does not happen with TextEdit, BBEdit, or any other app I tested -- anything copied to the clipboard in those apps remains on the clipboard after I quit them.

So my tentative conclusion is the clipboard data does not 'expire' because it doesn't get used quickly enough by some other app but because quitting Affinity Designer 'expires' it. Of course, I can't test this on Windows but I suspect it does the same thing.

If I am right about all this & AD is just 'overly aggressive' about cleaning up when quit, it hopefully will be easy enough for the developers to fix in a future release. For now, as a workaround just not quitting AD until the desired data is pasted into another app should work.

All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Posted
3 minutes ago, Lagarto said:

On Windows the SVG data is placed on Clipboard as non-text data so this feature cannot be tested.

I am not a Windows user so I cannot test this for myself but this earlier post  by @walt.farrell seems to suggest that with "Copy items as SVG" enabled, Windows does place the SVG data on the clipboard as text.

7 minutes ago, Lagarto said:

But I have now tested this so many times on macOS (Mojave) that I can say it behaves inconsistently (=erratically): sometimes the data stays there, sometimes it "appears" to be getting expired for no obvious reasons.

I have not tested this exhaustively on my iMac (also running Mojave) but so far there is nothing erratic about it: as long as AD is running & nothing else is copied to the clipboard, with "Copy items as SVG" enabled the text version remains on the clipboard & can be pasted into other apps like TextEdit or BBEdit as text. It is also what I see with  Finder > Edit > Show Clipboard. It even pastes as text into some places I would not expect it to, like in the Search field in Apple Messages, Apple Mail, Finder windows, & Spotlight searches.

It also consistently is removed from the clipboard (leaving it empty) the moment I quit AD.

Time permitting, I will try to do more testing but at least on my iMac it 'expires' exclusively for one of three reasons:

  1. I quit AD
  2. I copy something else to the clipboard
  3. I paste it into a location in an app that does not accept XML formatted text & instead pastes either nothing or pastes one of the other data types on the clipboard like a hypertext link, a PNG image, etc.

I need do more testing with the 3rd procedure to see if it is the same with different apps, but that seems to be the only potential source of  inconsistency I have as yet not fully explored.

All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Posted
32 minutes ago, R C-R said:

seems to suggest that with "Copy items as SVG" enabled, Windows does place the SVG data on the clipboard as text.

Yes, Affinity puts text data in the Clipboard with that option active. However, when it does that it does not supply a .txt format, but a Scalable Vector Graphics format and an inkscape-related svg format. Both contain text, but as they are not labeled as text it's likely that most text editors won't recognize them as such.

I believe the screenshots above from Mac included a text version, which is not present on Windows.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.