Basic features

This page illustrates many of the basic features of SciptX:

  • Simple javascript sets a custom header and footer and selects landscape for the page orientation on printout
  • A custom font and colour is set for the header and footer
  • Print an embedded iframe element

This page does not illustrate setting margins although this is available as a basic feature. Setting margins reliably means you must be able to control the units used. This is an advanced feature of ScriptX.

Setting the required print attributes is easy:

// SetupPrint
// Initialise print attributes, 
// will be reset when the document closes.
function SetupPrint() {
   const p = MeadCo.ScriptX.Printing;
   p.header = "ScriptX Basic features";
   p.footer = "&D&b&b&p of &P";
   p.orientation = "landscape";
   p.headerFooterFont = "font-family: Comic Sans MS;" +
        "font-size: 16px;" +
        "color: rgb(0,128,0);" +
        "font-weight: bold;";
}
            

Use the menu at the top of this page to try a print action.