Open SVG File, manage it and save it

Hi!
i'm new using java and batik
i've a svgFile.svg and i want to manage it, and later to save the changes in a newsvgFile.svg
i open the svgFile.svg and i put it in a 'org.w3c.dom.Document docSVG'
now i want to manage it, but i suppose it wont be a problem with batik toolkit...
but the problem is this:
now i want to save my 'org.w3c.dom.Document docSVG' into a newsvgFile.svg... then i do this:
import java.io.IOException;
import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.batik.dom.GenericDOMImplementation;
import org.w3c.dom.DOMImplementation;
public class Manager {
public static void main(String [] args) throws IOException {
//SVGDatei is a function to put the svgFile.svg in org.w3c.dom.Document docSVG
SVGDatei svgDatei = new SVGDatei();
DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
SVGGraphics2D svgGenerator = new SVGGraphics2D(svgDatei.docSVG);
svgGenerator.stream("svgFile.svg", true);
But this code only generate a empty svg file in 'svgFile.svg '
Why don't load my document??
Somebody can help me?
Thank you!
Xavi.

Hi martin!
Sorry, I don't understand the question: Do you hace a CVS (Current Version System) client setup?
client setup? for??
[ maybe you can send me some of this 'chunks of code' to take a look.. my e-mail: xavier(dot)murillo(at)student(dot)uni-ulm(dot)de ]
thank's a lot.
xavi

Similar Messages

  • Script to open SVGs in a folder and save them to one multipage PDF

    Hi.
    I'm using Illustrator for work and I love it, I never needed scripts yet.
    Now I have couple houndred svgs coming in per day,
    I would like to have a script that opens every svg one by one in the selected directory and add them to a pdf
    as pages of the same size and than save it.
    Is this possible? How many files I could put in 1 pdf this way?
    I'm using Illustrator CS5 on Win7 x64.
    Thanks in advance.
    Istvan

    I think there is a 100 file limit on artboards ( not tested ) but the size would also affect that… You can't straight place *.svg but you can make group from them would that do you?
    #target Illustrator
    function filesToArtboards() {
              // My function variables…
              var doc, fileList, i, inFolder, mm, svgFile;
              // Get the user to select a folder
              inFolder = Folder.selectDialog( 'Please choose your Folder of files to place…' );
              // Check they ain't cancelled
              if ( inFolder != null ) {
                        // Gets just the SVG files…
                        fileList = inFolder.getFiles( /\.svg$/i );
                        // Make sure it has AI files in it…
                        if ( fileList.length > 0 ) {
                                  mm = 2.83464567 // Metric MM converter…
                                  // Set the script to work with artboard rulers
                                  app.coordinateSystem =
                                  CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
                                  // Add new multi-page document
                                  doc = app.documents.add(
                                             DocumentColorSpace.RGB,
                                             width = 148.5*mm,
                                             height = 210*mm,
                                             numArtboards = fileList.length, // The number of SVG files
                                             DocumentArtboardLayout.GridByCol,
                                             artboardSpacing = 20*mm,
                                             artboardRowsOrCols = Math.round( Math.sqrt( fileList.length ) )
                                  // Loop thru the counter
                                  for ( i = 0; i < fileList.length; i++ ) {
                                            // Set the active artboard rulers based on this 
                                            doc.artboards.setActiveArtboardIndex( i );
                                            // Create group from SVG
                                            svgFile = doc.groupItems.createFromFile( fileList[i] );
                                            // Move relative to this artboards rulers
                                            // Top Left
                                            sgvFile.position = [ 0, 0 ];
    filesToArtboards();

  • Is it possible to open gerber files in Illustrator and save them as .eps?

    Well?
    //ekmanch

    If by Gerber, you mean Gerber Scientific Products Omega software, no. You cannot directly open or import their proprietary fromat into Illustrator.
    On the other hand, Omega will export to both AI and EPS formats, so why would you need to?
    --OB

  • "An error occurred while opening the file dialog. Please save your presentation, exit, and restart PowerPoint."

    In PowerPoint 2013 on Windows 7 - 64 bit, when
    File / Save as is selected, an error message comes up stating, "An error occurred while opening the file dialog. Please save your presentation, exit, and restart PowerPoint." This is an intermittent issue and also
    affects Excel 2013. I have tried repairing it, done windows update and also uninstalled and reinstalled but no luck. I have researched this issue but it relates to Office 2007 and 2010 and the resolution does not support 2013.
    Has anyone come across this issue? If so how did you resolve it?
    Many thanks….

    Hi,
    You mentioned you tried some steps but I'm not sure what they are, you may try my suggestion to resolve this issue, follow these steps:
    Click Start, right-click Computer, click
    Properties, and then click Advanced system settings.
    On the Advanced tab, click Environment Variables.
    Locate and select the __COMPAT_LAYER variable, and then click Edit.
    Set the value of the __COMPAT_LAYER variable to EnableThemes. Or, delete the __COMPAT_LAYER variable.
    If the issue persists, we can troubleshoot this problem in Clean Boot to determine whether background programs are interfering with PowerPoint:
    http://support.microsoft.com/kb/929135
    Regards,
    Melon Chen
    TechNet Community Support

  • Import/Open SVG Files in Fireworks CS5!

    Hey,
    I really need to import/open SVG files in Fireworks CS5. I have been searching the Web for days now, but I can't find anything. The reason for this is that I get thousands of files sent to me in SVG format that I needto incorporate into my designs made in Fireworks. I solve it today by opening the files in Illustrator, copy each one of them, paste in Fireworks... WTF!
    So please tell me someone made this easy for me?
    Many thanks!

    I also have this problem. I didnt exatly find a solution, however here's the way i learnt to use .svg without losing editability in Fireworks.
    1. Download Inkscape as suggested by Joyce Evans Erb. Here
    2. Open the SVG file you need to work with in Inkscape.
    3. Go to File > Save As and select .eps (Encapsulated PostScript)
    4. Open the saved .eps file in Fireworks.
    Now you might get a bit of unnecessary space around the file but it should work out just fine.
    Also, if you havn't already go check out thenounproject.com . It's a great resource for us Fireworks types.
    As a final note, i'd just like to plead with Adobe to put a bit more effort into Fireworks. It's a great program that i feel is being dragged along with the suite. (Hope to see some really awesome stuff in Fireworks CS6.5 *wink* )

  • [Solved] Auto-open a file manager after mounting with udev rules

    Hellooooo,
    I followed the udev Wiki for auto mounting USBs and it now works great.
    The only problem is: how can I automatically open a file manager of the mounted directory? I tried putting this at the end of the "ACTION=="add"," section in "/etc/udev/rules.d/11-media-by-label-auto-mount.rules" but for some reason nothing happens:
    , RUN+="/usr/bin/dolphin /media/%E{dir_name}"
    Even if I just try to open dolphin with the "ACTION=="add"," section nothing happens either way.
    So what am I doing wrong?
    Last edited by algorythm (2011-05-05 12:35:56)

    In that case, the best choice in my opinion is to use Automounting UDisks Wrappers :
    devmon is a script developed by IgnorantGuru. He left Arch Linux, but the package in AUR is still there and is the last version. For a future new release, it should be available at his blog site. The script is distro independent.
    My udisksvm script, in its default state, doesn't launch a file manager after automounting, but it is not a big thing to let the automounting be done and then manually open a file manager (a new entry in the traydevice right-click menu can also be added for that).
    If you can do without automounting, there is also the bashmount script from jnguyen.
    All these scripts don't require writing any udev rules, they use udisks instead.
    I hope you could find something you like and which will suit your wishes.

  • [Solved by adding GQview]Is Feh not capable of opening svg files...?

    I have installed Feh from the community repos, along with imlib2. according to the official website, feh can open SVG files, but I get an error...
    feh WARNING: /home/jaydoc/archlinux-artwork-1.1/logos/archlinux-grad1-dark.svg - No Imlib2 loader for that file format.
    So is feh capable of doing this or not..? Am I missing any needed dependency..? I don't want to use inkscape etc, as they seem to have a lot of dependencies.
    Last edited by jaydoc (2009-04-07 19:45:18)

    jaydoc wrote:
    @skottish...
    I tried using gqview to set the wallpaper. trouble is, when I log out and back in, Openbox is unable to 'remember' the wallpaper used. When using feh, I used the eval cat command in autostart. Is there something similar for gqview too...?
    anyway, I am now using feh to set the wallpaper - because I need to use imlib2 anyway to use scrot., so feh adds just 0.25 MB more..!
    I browse images with gqview and can set the wallpaper with feh from it.
    In the gqview preferences go to editors and add feh wallpaper with feh --bg-scale %f as the command
    I put mine #2 under gimp so while browsing images in gqview i can hit control 2 and it sets it as wallpaper or right click and go to edit>feh wallpaper.

  • Favor to ask : can you open this labview 2009 Vi and save it for me in a Labview 8.6 readable vi ?

    Hi guys, 
    I have a favor to ask : May somebody would be nice enough to open this Labview 2009 VI and save it in a Labview 8.6 readable VI  ? You'll probably have some missing blocks cause I use specials ones but I don't want to have to re-make all the VI.
    Thanks you very much
    G.
    Solved!
    Go to Solution.
    Attachments:
    Control3.vi ‏29 KB

    notimperial wrote:
    Probably not the right place to do this, but could someone onpen this in labview 2010 and save it in a format compatible with labview 2009?
    Thank you in advance
    You are right we have a thread for this here.
    http://forums.ni.com/t5/LabVIEW/Downconvert-VI-Req​uests/m-p/1067229
    Here is your vi please use the downconvert thread next time.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    WFMreaderIII.vi ‏53 KB

  • I can't open pages files from USB and iCloud due to : "The necessary file index.xml is missing".

    I can't open pages files from USB and iCloud due to : "The necessary file index.xml is missing". Original file is written on iMac (2014) and saved to an USB stick and then transferred till macBook Pro (2009, Yosemite) for editing. Then I shared the files by iCloud but I am not able to open them on iMac again. Niether can I use the USB stick to transfer the edited files back. I'm running Pages '09 4,1 (923) on the macBook and Pges 5.5.2 (2120) on the iMac.
    Håkan

    Pages 5.5.2 is extremely incompatible with even other Macs let alone the vast majority of PC and MsWord users out there, so not a good idea to leap into the fire with both eyes shut.
    After having done that to the first Pages 5 files, Apple has repeatedly done it to even the most minor point updates. Apple can't even anticipate its own erratic changes let alone what everyone else needs doing.
    Peter

  • Went to open a file in words and got message. "You need a newer version of Pages to open this document." I have latest version.  All other files open w/o a problem.  Please help.

    Went to open a file in words and got message. "You need a newer version of Pages to open this document." I have latest version.  All other files in words open w/o a problem.  Please help.
    Thank you.
    <Email Edited by Host>

    You have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed almost 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Peter

  • Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Aftershotz,
    You're going to have to give a bit more information.
    What do you mean by "opening a file in library?"  There is no function of Aperture to open files -- you can open (switch) libraries.
    You'll have to be more specific about error messages, too.  Perhaps some screenshots would be useful to diagnose your problem.  "Can't open database with library name" is not enough detail about what Aperture is really telling you.
    nathan

  • Unable to open d800 files with cs6 and camera raw 8.3

    unable to open d800 files with cs6 and camera raw 8.3

    Have you used Nikon Transfer on those files? Early versions are known to corrupt files so that ACR can't read them. Nikon has since fixed the bug so new versions are safe.
    Here's a thread (with a fix) in the Lightroom forum: https://forums.adobe.com/message/6253962

  • Adobe flash error when opening a file is closed and leaves open the file

    the problem is this I try to open a file FlippingBook Publication and try to open it immediately closes and says there are problems with adobe flash player 10.1 r102 you uninstall and reinstall the latest version adobe the problem continues, anyone know how to fix it?

    adobe flash player 10.1 r102
    Is there a specific reason you're using a five-year-old Flash Player version?

  • I want to open a html file in word and save it as docx programmatically using activex

    can i open a .html file in microsoft word and save it as a .docx file programmatically ?

    What does your question have to do with instrument control? Does it have anything to do with any NI software?

  • Opening Powerpoint files in Mac and PC

    Hi. I sometimes have to create presentations on my MacBook using Powerpoint (I know! Keynote is better and I love it.). I am using Powerpoint 2004 for Mac version 11. I recently discovered that I can't open some powerpoint files on Windows-based computers with Microsoft Powerpoint 2003 Professional Edition, but could open them with a 2002 version. Does this have something to do with the windows version or my Mac? Since I have to share the files with my colleagues, I often have to open the files from someone else's computer (which has a 2002 PPT version) then save the file to a PPT 97-2003 & 95 version just so my colleagues with a 2003 version can open the files. Is there a simpler way to solve this compatibility problem? Hope someone can help me. Thanks!

    Hi Orange Girl
    I have tried to replicate your problem using two different versions of PowerPoint 2003 on two different computers and have managed to open the files without any problems.
    Which specific versions of PowerPoint do you have on the Mac and the PC.
    On the Mac
    From the menu
    PowerPoint > About PowerPoint
    Example
    Version 11.0 (104441)
    On the PC
    From the menu
    Help > About Microsoft Office PowerPoint
    Example
    11.5529.5606

Maybe you are looking for

  • How do i make my iphone 5 bluetooth not discoverable

    How do i make my iphone 5 bluetooth feature "not" discoverable so that my phone is secure from hacking while i am in public and the bluetooth feature is turned on.

  • Can't open project unless trash prefs or eject ext hd... ???

    I want to start off by apologizing ahead of time if I miss a detail or seem like I am rambling but I am going on 48 hours no sleep, half of which trying to figure out my problem, and my doc's air date is quickly quickly approaching. I will try to mak

  • So Far... Disappointed in Windows Phone 8 offerings

    I was really excited about getting both my son, and I, new Windows 8 phones to offset the new iPhone 5's my wife and daughter just received. I was particularly looking forward to the rumored Samsung ATIV S as it has everything I was looking for. Scre

  • Scalable service instance deregistered on multi-zone cluster

    I have a pair of systems clustered with multiple zones configured on each. The zones are not clustered, however the dataservices are run on the zones in pairs. Some services are failover, some are scalable. The problem arises with the scalable resour

  • LabVIEW laplacian filter

    I just loaded LabVIEW 2013 and the Vision Module 2013, although I have used LabVIEW for years. I have a project requiring machine vision. I started up the Vision Assistant, and used some of the tools to see what would work. I found that applying the