Copy link to clipboard
Copied
This is a example:
i can using fillColor to set background, but how can display the same a triangle (refer image)?
Copy link to clipboard
Copied
If you mean using patterns such as Illustrator does, I don't think you can.
Copy link to clipboard
Copied
No patterns, but a clipping mask can do it. "Clipping mask" is Illustrator terminology; in InDesign you'd manually copy the triangle and paste it into the white filled rectangle.
In scripting terminology, that is what the "rectangles", "ovals", "text frames", "polygons" and "graphic lines" properties of a single rectangle are for: these items are contained inside the rectangle. So create one such object manually and then inspect how it is constructed in the DOM.
Copy link to clipboard
Copied
Once that said, I am pretty certain Marc did some experimentations with "patterns" inside InDesign but I can't find it back.
Copy link to clipboard
Copied
This code can create a triangle:
oRec = oDocument.Rectangles.Add()
oRec.FillColor = oDocument.Swatches(7)
oRec.ConvertShape(InDesign.idConvertShapeOptions.idConvertToTriangle)
oRec.RotationAngle = 270
Copy link to clipboard
Copied
Hi,
I still don't get what you want to achieve.
Can you post a screenshot where you fake the result?
If you want a custom pattern and use it as fill: InDesign has no feature for that. Illustrator has.
With InDesign you have to repeat a shape in various ways.
You also could look into PostScript programming code and generate a EPS file with a pattern and place that to fill a shape.
Found this: Postscript programming
Regards,
Uwe
Copy link to clipboard
Copied
This is a sample indd file:
I can create a triangle by code:
oRec = oDocument.Rectangles.Add()
oRec.FillColor = oDocument.Swatches(7)
oRec.ConvertShape(InDesign.idConvertShapeOptions.idConvertToTriangle)
oRec.RotationAngle = 270.
My problem is setting corner the same file sample.?
Copy link to clipboard
Copied
daitranthanhoa wrote
My problem is setting corner the same file sample.?
Yeah that needs more words.
Copy link to clipboard
Copied
you can refer file example at: Dropbox - Untitled-4.indd
i want set Radius of 3 corners.
i try using CornerOption = Rounded, but it still not the same example .
Copy link to clipboard
Copied
Full my code:
Dim oRec = oDocument.Rectangles.Add()
oRec.FillColor = oDocument.Swatches(7)
oRec.ConvertShape(InDesign.idConvertShapeOptions.idConvertToTriangle, 100, 100, 4)
oRec.RotationAngle = 270
oRec.TopLeftCornerOption = 1667592804
oRec.TopRightCornerOption = 1667592804
oRec.BottomLeftCornerOption = 1667592804
oRec.BottomRightCornerOption = 1667592804
Copy link to clipboard
Copied
Hm. I'd wish InDesign had a PostScript editing interface like FreeHand once had for generating PostScript patterns*.
Also found this:
Tiling in PostScript and METAFONT – Escher’s wink
Kees van der Laan
http://www.ntg.nl/maps/19/12.pdf
Regards,
Uwe
* not really. You can do very dangerous things with a interface like this.
Copy link to clipboard
Copied
Looks like to me you wouldn't expect such a specific result from "generic" methods or properties. You would probably need to set your own geometry here.