This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Exporting a class diagram in SVG creates an SVG file as expected. However, instead of creating various shapes and text elements, the file defines a single image element with binary PNG image data written in base 64. This behavior was discovered on a class diagram generated from a reverse engineered NetBeans project. Other diagrams were not tested.
Created attachment 53265 [details] a sample of the generated SVG
The same occurs with component diagram for platform-independent model. If I am not mistaken in previous versions the export generated truly vector image.
Created attachment 54442 [details] SVG file generated with NetBeans 5.5.1 (truly vector graphics)
I just tested NetBeans 6.1beta and run into the same bug. It is really a shame. If you embed the UML diagrams produced by NetBeans into a scientific paper (using LaTeX) they look really crappy... Issue#129033 looks like a duplicate of this report.
I have looked at the history of org.netbeans.modules.uml.ui.products.ad.viewfactory.ETEGraphImageEncoder class. This class extends com.tomsawyer.editor.TSEGraphImageEncoder, which has writeSVGFormat() method. That method was used in NB5 and produced vector image. 8 months ago this was changed to getting a bitmap (BufferedImage) of the diagram and passing it to Batik to encode as SVG. This way the saved file can not be vector graphics. This change has the following log: "Export as Image to svg file uses incorrect font size override TomSawyer lib to use our own svg export logic." Could this change be reverted since it has broken the SVG export?
For those interested in fixing this bug on their instalation: I have substituted file org/netbeans/modules/uml/ui/products/ad/viewfactory/ETEGraphImageEncoder.class in org-netbeans-modules-uml.jar in NetBeans 6.0 with the same file from NetBeans 5.5.1. The SVG export started working properly. But remember, do it at your own risk. ;-)
The change you reverted by going back to the 5.5.1 version of ETEGraphImageEncoder.class was an attempt to fix issue 78585. Which behavior is more desirable, with or without the fix for 78585? If anybody has an idea on how to fix both issues, we would welcome the help. Thanks, George
fixed. author lvv@netbeans.org Tue Mar 25 19:47:34 2008 -0800 (1 second ago) changeset 75549 b7d9ddfcdbda parent 75484 94651a4d51f1 child 75550 8c254808a557 Fix for 122435 SVG export creates a bitmap
*** Issue 129033 has been marked as a duplicate of this issue. ***
verified in NB 6.1 latest continuous trunk build 1340 (20080327130455). Different options have been verified as well and viewed with batik and FireFox's add-in. The exported svg files are scaled very well in size from the svg viewers. The only issue with it is when it's exported to a customized size like 20x20, then the labels and graphics are not displayed properly but I don't think this is a size people would export to anyway.