Skip navigation
Currently Being Moderated

Vectorize paths in InDesign

Mar 18, 2010 2:36 PM

Looking for a script to vectorize paths in InDesign.


Or someone to show me where is the InDesign's vectorize command (for paths, not types)…

  • Currently Being Moderated
    Mar 18, 2010 4:13 PM   in reply to lesyeux

    Paths in InDesign are (non-arguably) already vectors ...


    Can you give an example of what you want to do?

    Mark as:
  • Currently Being Moderated
    Mar 19, 2010 3:12 AM   in reply to lesyeux

    Can I ask how you are doing this in Illustrator as I have NOT been able to find this method in the object model?

    Mark as:
  • Currently Being Moderated
    Mar 19, 2010 3:31 AM   in reply to lesyeux

    Aha -- Illustrator's "Expand Appearance" option.

    Possible ... sure. Up to a certain level, it's even easy (and after that level it rapidly becomes incredibly difficult!).


    Every object always has a Paths array -- InDesign always allows multiple paths in any single object (making a hole into something with the pathfinder adds another path in the same object). Every path, in turn, has a single property entirePath, which you can use to loop over and inspect every single path point.


    The easiest way I can think of is creating a circle with a diameter of the path's line width on each of the path's points, calculate the extents of each circle in the direction of the next point, then add a rectangle to fill up the middle:




    That's only covering (so to speak) straight lines. To do the same with curves, you can decompose them into lots of straight lines (but not too short -- not any shorter than your line width) and hope no-one notices, or do some horribly complicated maths.


    If you're interested in this stuff, check -- it's mainly targeted at raster (pixel) graphics, but a large part of that includes expanding mathematical lines to thick strokes.

    Mark as:
  • Currently Being Moderated
    Mar 19, 2010 5:35 AM   in reply to lesyeux

    QuarkXPress has it!? Oh well, let's wait for CS5 then ...

    Generally, stuff like this is best done with illustrating software (yup, Illustrator). Is there a special reason you need to do this with InDesign, or were you just curious if it was possible at all?


    I can have a go at it with Javascript, using the method I described above, but I'm drawing the line (pun intended ) at curves. Straight line segments ought not to be a problem -- would that be enough? For anything moderately more difficult, I'd recommend copying the path and pasting it straight into Illustrator, do your stuff, then save as AI and place into InDesign.

    Mark as:
  • Currently Being Moderated
    Mar 19, 2010 5:36 AM   in reply to lesyeux

    The 2 options that you quote are both available thru the GUI of the app but I have found NO way (to date) of calling this method via JavaScript.

    I could do this with AppleScript calling actions but you can't do this with JavaScript. When I looked up doing the math for this in JavaScript I gave up… Too much has been forgotten since school…

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points