S Commands

PageStream S Command Reference



S Commands  Command Section By Letter  url:PGScmd/s commands
  created:2006-03-10 16:50:14   last updated:2006-06-10 10:31:44
  Copyright © 1985-2024 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For S Commands
Tim Doty wrote...2006-05-16 19:19:51

SaveBorders Border Extension


This command saves all loaded borders into a bundle named borders.library. The file is saved into Softlogik/Engines.


Extension SaveBorders

AddBorder, DeleteBorder

Suggested enhancement:
SaveBorders {<border name>} [PATH <path>] [FILE <file>]
<border name> the name of the border to save. Normally all borders are saved -- this specifies the border(s) to save.
PATH <path> the path to save the border(s) to. Normally all borders are saved in the program directory (Softlogik/Engines/) but in some cases the user won't have write privileges to that location. This allows a writeable location to be specified.
FILE <file> the file name to save the border(s) under. Normally this is borders.library which is then renamed as appropriate. This allows the border to be saved with the desired name.

Note: the curly braces indicate that the entry can be present zero, one or more times. Each named border is saved.

Note2: due to the additional options there are more error conditions that should be reported through .error.
INVALID PATH -- specified PATH does not exist
UNWRITEABLE PATH -- specified PATH cannot be written to
INVALID FILE -- specified FILE cannot be created (usually illegal characters in the file name)
INVALID BORDER -- a list of specified borders which are not found.
There are three general states: success (no errors), partial (INVALID BORDER, but one or more borders were saved) and failure (INVALID PATH, UNWRITEABLE PATH, INVALID FILE, or all border names were invalid)

Just a cursory go at this so I've probably mucked up errors, but the intent should be clear.

Tim Doty wrote...2006-05-16 19:43:13

SetBorder Border Extension

This is the swiss knife of border commands and is used to set the path to use for a given position or to configure the size of the border.

SetBorder <border name> <position> <index> <id> <flip> <scale> <number>
<border name> the border to alter
<index> 0 to 3 for corner or middle pieces, 0 to 7 for dashes. The keyword ALL can be substituted to mean all indexes for that position.
<id> the id of the path to use for the given position
<flip> FLIP | DONTFLIP whether or not the path should be rotated to match the corner or side it is being position for
<scale> SCALE | DONTSCALE whether or not the path should scale with the drawing
<number> MANY | JUSTONE (only available for dash positions)

SetBorder <border name> <alteration> <size>
<border name> the border to alter
<alteration> DesignSize | DefaultSize
<size> a number in the current measurement system

PageStream borders are a means for having scaleable borders that always use the right number of pieces to make the whole. The following graphic is intended to illustrate the logical pieces of a border. A border doesn't need to have each position defined. For example, a simple border might use a single dash definition for each side and not use a middle piece at all.

Each corner of a border, each mid-point, and the dash(es) on either side of a mid-point can be different. If all corners are to be the same except flipped appropriately then they can be defined from a single path using a single command specifying FLIP. That is, use FLIP for the upper right corner if it is a mirror of the upper left corner, and so on.

Note that if a middle point is set the dash on each side must be defined if dashes are desired on both sides. Or put another way the dash will only run from corner to corner if a middle point is not defined.

All flipping of paths is done with respect to the border from its orientation with respect to CORNER 0, MIDDLE 0 or DASH 0 as appropriate. All pieces are numbered from the upper left corner in clockwise fashion.

Corners (at least) are aligned to the lower right corner. This is signifiant if the path does not extend to the lower right corner which is quite possibly the case for corners other than the upper left. To work around this for DONTFLIP corners pre-flip the path and align it to the lower right corner when using AddBorderPath and specify FLIP when using SetBorder. Then PageStream will "unflip" the path to the correct orientation and it will have the correct alignment.

To set all corners of My Border to use the path added as index 0 with the path to be rotated appropriately and scaled when the border is sized use:

Extension SetBorder "My Border" CORNER ALL 0 FLIP SCALE

AddBorder, AddBorderPath, DeleteBorderPath, SetBorderPath

Tim Doty wrote...2006-05-16 20:00:13

SetBorderPath Border Extension

This command is used to adjust the dimensions of a path after it has been added to a border.

SetBorderPath <border name> <index> [WIDTH <width>] [HEIGHT <height>] [PATHWIDTH <width>] [PATHHEIGHT <height>]



To pad a path by 50% of its width on either side where the path is identified as index 1 and was added with a width of 4.5 inches.

Extension SetBorderPath "My Border" 1 WIDTH 9

AddBorder, AddBorderPath, SetBorder, DeleteBorderPath

User Contributed Comments For S Commands