T O P I C R E V I E W |
Adequat |
Posted - Sep 14 2018 : 03:28:14 AM It would be great if your FileViewer plugins could preview SVG files (https://en.wikipedia.org/wiki/Scalable_Vector_Graphics)
I have recently switched from PNG for my documentation graphics to SVG. PNG are previewed correctly. |
12 L A T E S T R E P L I E S (Newest First) |
sean |
Posted - Dec 03 2018 : 6:29:18 PM case=119335 is implemented in build 2301 |
feline |
Posted - Sep 20 2018 : 4:32:53 PM Adding HTML to the list of languages I don't know enough about |
sean |
Posted - Sep 20 2018 : 12:24:58 PM Bingo! Thanks. |
Adequat |
Posted - Sep 20 2018 : 03:18:44 AM You simply needs to declare it's a HTML5 page and it will work, simply like this:
<!DOCTYPE html>
<body>
<img src="overall-architecture.svg" />
</body>
</html>
HTML5 can preview lots of thing. This might be an idea to display even more stuff.
|
sean |
Posted - Sep 19 2018 : 12:14:02 PM This code works for displaying the image in a browser, but it doesn't work in the file viewer plugin:
<html>
<body>
<img src="./bitmap_vs_svg.svg" />
</body>
</html>
Maybe a security policy issue in the plugin... |
feline |
Posted - Sep 19 2018 : 07:26:04 AM OK... which OS are you using? Also, which IDE and version of VA are you using?
I was testing this under Windows 7, but I have just tried it under Windows 10 as well, and the SVG image is not shown, when wrapped in HTML, on either machine for me. In case the problem is my wrapper, I am using this:
<HTML>
<IMG SRC="overall-architecture.svg"></IMG>
</HTML> in a file called "overall-architecture_wrapper.html". The same file extension and HTML works with a .PNG file, so I would expect this to work for a SVG file as well.
So it looks like this working or not depends on some extra variable. |
Adequat |
Posted - Sep 19 2018 : 04:32:21 AM quote: I tried wrapping the SVG file in a very simple HTML file, that simply shows the image, but this does not work in the HTML viewer SourceLinks is using
Yes, it does work. I tried it. With both cases: SVG as external file referenced by the HTML file, or inlined SVG inside a HTML page.
quote: Have you considered writing your own SourceLinks plugin to preview SVG files?
Really not have the time :(
|
feline |
Posted - Sep 17 2018 : 5:41:30 PM I was thinking this would work well for flow diagrams, and other such types of diagram.
Have you considered writing your own SourceLinks plugin to preview SVG files? I tried wrapping the SVG file in a very simple HTML file, that simply shows the image, but this does not work in the HTML viewer SourceLinks is using. So the HTML viewer is not handling everything a full web browser does, which makes sense for a preview. But then its a question of where you draw the line for what the previewer should support... |
Adequat |
Posted - Sep 17 2018 : 4:19:50 PM Note that PlantUML, unlike its name suggests, has a much wider scope than UML. Lots of diagrams of different types can be easily built. |
feline |
Posted - Sep 17 2018 : 09:13:09 AM I have not come across UML in years, but yes, this is a natural fit for a vector graphics format. Thank you for the sample images, I have put in a feature request for this:
case=119335
As for using the HTML preview to preview the images, it depends on the control used, and what it supports. There are quite a lot of graphics formats, and not all programs can preview all of them. Plus we want the file viewer to be lighter weight than a full web browser. |
Adequat |
Posted - Sep 16 2018 : 02:13:14 AM I personally use SVG with the great tool http://plantuml.com/class-diagram PlantUML can render SVG grphics.
SVG ("Scalable Vector Graphics") is an XML based format to draw two-dimensional vector graphics. This is not used to save "common" photos, it has more in common with a web page that it does with a PNG. This format is natively supported by all web browsers and is gaining momentum because SVG is a key part of HTML5. For my documentation purposes, SVG has the following advantages:
1. Pictures scale perfectly in web browsers (vector graphics) 2. URL can be inserted inside graphics 3. Any text in the SVG picture, displayed in the web browser, can be selected / copied, unlike with a freezed picture. 4. Smaller picture files
SVG graphics are complex to render. But I think you have a very easy solution... SourceLink can preview HTML pages... and SVG are rendered easily in web pages: hence use your HTML preview to display an on-the-flay HTML page that only contains the SVG file.
Find here some online SVG only pictures, all originating from PlantUML (right click and do "Save Image As"). https://blog.frankel.ch/assets/generated/developing-around-plantuml/overall-architecture.svg https://plantweb.readthedocs.io/_images/ddcd30f09f9f9b6d0ec8ed7f8292813c178e368f91bb2b5f989ca18133e2b50e.svg big one: http://pierre3net.azurewebsites.net/Content/image/classDiagram_m-vm.svg
|
feline |
Posted - Sep 14 2018 : 08:43:18 AM Do you have a couple of test images I could attach to the feature request? I have just tried two different image programs on my computer, and neither offer the option to save out an image in SVG. So its this or start pulling random images out of the internet... I have concerns about where this might lead
If you do have a couple of sample images we can use, please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up. |