1 Reply Latest reply on Jan 29, 2016 2:43 AM by c.pfaffenbichler

    Is it possible to open an SVG file at a specific resolution?

    victorh41219288

      Hi,

       

      Now that PhotoShop can open SVG files directly, I wanted to try and incorporate this into a script. The standard support for app.open() still only specifies EPS, RAW, PDF etc.

       

      I have tried to convert an action into javascript to see if this would achieve it. The code I code is below and it does work (even if I don't really understand what it's doing).

       

              jamEngine.jsonPlay
              (
                  "open",
                  {
                      "target":
                      ["<path>",fileName],
                      "as":
                      [
                          "<object>",
                          ["svgFormat",
                              {
                                  "resolution":["<unitDouble>",["densityUnit",300]],
                                  "mode":["<enumerated>",["colorSpace","RGBColor"]],
                                  "antiAlias":["<boolean>",true]
                              }
                          ]
                      ],
                      "documentID":
                      [
                          "<integer>",
                          195
                      ]
                  },
                  DialogModes.NO
              );

       

      I have put this into a function but can't work out how to set the resolution. I have tried converting multiple actions at different resolutions to see if there is any difference in the code but they appear the same.

       

      Can any help? I am working with a library of SVG images and pre-processing the files to convert them using other tools into something easier to open defeats the object.