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.

Bug 122435 - SVG export creates a bitmap
Summary: SVG export creates a bitmap
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Viktor Lapitski
URL:
Keywords:
: 129033 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-20 21:27 UTC by djvogt
Modified: 2008-03-28 00:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a sample of the generated SVG (84.84 KB, text/plain)
2007-11-20 21:28 UTC, djvogt
Details
SVG file generated with NetBeans 5.5.1 (truly vector graphics) (303.27 KB, text/xml)
2007-12-21 08:57 UTC, ppp5
Details

Note You need to log in before you can comment on or make changes to this bug.
Description djvogt 2007-11-20 21:27:34 UTC
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.
Comment 1 djvogt 2007-11-20 21:28:21 UTC
Created attachment 53265 [details]
a sample of the generated SVG
Comment 2 ppp5 2007-12-20 20:26:01 UTC
The same occurs with component diagram for platform-independent model. If I am not mistaken in previous versions the 
export generated truly vector image.
Comment 3 ppp5 2007-12-21 08:57:31 UTC
Created attachment 54442 [details]
SVG file generated with NetBeans 5.5.1 (truly vector graphics)
Comment 4 rost 2008-03-14 20:54:39 UTC
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.
Comment 5 ppp5 2008-03-17 14:59:29 UTC
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?
Comment 6 ppp5 2008-03-21 17:42:10 UTC
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. ;-)
Comment 7 George Vasick 2008-03-25 15:58:46 UTC
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
Comment 8 Viktor Lapitski 2008-03-26 03:53:01 UTC
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 
Comment 9 George Vasick 2008-03-26 18:58:44 UTC
*** Issue 129033 has been marked as a duplicate of this issue. ***
Comment 10 Peter Lam 2008-03-28 00:40:27 UTC
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.