Loading ...
Sorry, an error occurred while loading the content.

Re: Save SVG as PNG file?

Expand Messages
  • Jan
    I get the following error when I try to execute the java command line below: C: Program Files Batik SVG Browser batik-1.5.1 java -jar batik- rasterizer.jar -
    Message 1 of 16 , Mar 1, 2005
    • 0 Attachment
      I get the following error when I try to execute the java command line
      below:

      C:\Program Files\Batik SVG Browser\batik-1.5.1>java -jar batik-
      rasterizer.jar -
      m image/png anne.svg
      Exception in thread "main" java.security.AccessControlException:
      access denied (
      java.util.PropertyPermission java.security.policy write)
      at java.security.AccessControlContext.checkPermission(Unknown
      Source)
      at java.security.AccessController.checkPermission(Unknown
      Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.System.setProperty(Unknown Source)
      at
      org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityMana
      ger(Unknown Source)
      at
      org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(Unk
      nown Source)
      at org.apache.batik.apps.rasterizer.Main.execute(Unknown
      Source)
      at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)


      Does anyone know why?

      Jan

      --- In svg-developers@yahoogroups.com, Thomas DeWeese
      <thomas.deweese@k...> wrote:
      > wywytse wrote:
      > >
      > > I have download Batik, but how can it automated render the SVG
      and
      > > save it as a PNG??
      >
      > If you got the binary dist. Then there is a jar file
      > called 'batik-rasterizer.jar'.
      >
      > The following should work assuming you are in the
      > release directory:
      >
      > % java -jar batik-rasterizer.jar -m image/png samples/anne.svg
      >
      > You can use -help to get a list of other options (like
      > output directory/file, etc).
    • Thomas DeWeese
      Hi Jan, What version of Java are you using? Is it possible you have a non-standard security policy installed? Anyway you can most likely get around this by
      Message 2 of 16 , Mar 1, 2005
      • 0 Attachment
        Hi Jan,

        What version of Java are you using?
        Is it possible you have a non-standard security policy installed?

        Anyway you can most likely get around this by using the
        '-scriptSecurityOff' switch (which disables the install of
        the script security policy).

        Jan wrote:
        >
        > I get the following error when I try to execute the java command line
        > below:
        >
        > C:\Program Files\Batik SVG Browser\batik-1.5.1>java -jar batik-
        > rasterizer.jar -
        > m image/png anne.svg
        > Exception in thread "main" java.security.AccessControlException:
        > access denied (
        > java.util.PropertyPermission java.security.policy write)
      • Thomas DeWeese
        Hi Aashish, ... Usually the problem is content without a viewBox attribute. The problem is that without a viewBox it is impossible to know what area of the
        Message 3 of 16 , Mar 1, 2005
        • 0 Attachment
          Hi Aashish,

          Aashish Singhvi wrote:

          > I tried with some of my SVG files. It is pretty easy to use.
          > However, (I don't know if this problem is specific to this utility or
          > within the Batik conversion software itself) if you have viewBox
          > attributes that do implicit transforms during viewing, the output may
          > not be correct.

          Usually the problem is content without a viewBox attribute.
          The problem is that without a viewBox it is impossible to know what
          area of the infinate canvas should be displayed. If you have a
          width and/or height specified it will render 0,0 w, h. If you
          don't have them either then it randomly chooses 0,0 400,400 as
          you have provided no useful indication of the region to render
          (people often suggest using the BBOX and in some cases this
          may be better, but often the bbox is not correct).

          This of course is all easily changed if you want to write
          a little code.
        • Jan
          ... Yes, I tried this and that worked. Thanks. ... I m also using width= 100% height= 100% . Guess I ll have to add a viewbox to my svg then and try again.
          Message 4 of 16 , Mar 2, 2005
          • 0 Attachment
            --- In svg-developers@yahoogroups.com, Thomas DeWeese
            <thomas.deweese@k...> wrote:
            >Anyway you can most likely get around this by using the
            >'-scriptSecurityOff' switch (which disables the install of
            >the script security policy).
            >
            Yes, I tried this and that worked. Thanks.

            > Usually the problem is content without a viewBox attribute.
            > The problem is that without a viewBox it is impossible to know what
            > area of the infinate canvas should be displayed. If you have a
            > width and/or height specified it will render 0,0 w, h. If you
            > don't have them either then it randomly chooses 0,0 400,400 as
            > you have provided no useful indication of the region to render
            > (people often suggest using the BBOX and in some cases this
            > may be better, but often the bbox is not correct).
            >
            > This of course is all easily changed if you want to write
            > a little code.

            I'm also using width='100%' height='100%'. Guess I'll have to add a
            viewbox to my svg then and try again. Thanks.
          Your message has been successfully submitted and would be delivered to recipients shortly.