de.dante.extex.typesetter.type.page
Class PageFactory

java.lang.Object
  extended byde.dante.extex.typesetter.type.page.PageFactory
All Implemented Interfaces:
LogEnabled

public class PageFactory
extends java.lang.Object
implements LogEnabled

This class provides a factory for page instances.

The separation of the page into a logical page and a physical page is depicted in the figure below.

Dimensions of a page

The physical page denotes the real paper. DVI has no notion of the physical page but PDF knows of those bounds. The logical page is placed somewhere on the physical page. The physical page has the width \mediawidth and the height \mediaheight.

The logical page is the area used by TeX to place material on. It has a reference point which is in its upper left corner. This reference point is 1 in right and 1 in down from the corner of the physical page. The reference point can be shifted further by using the dimen registers \hoffset and \voffset.

Parameters

The Dimen Parameter \mediawidth

The dimen parameter \mediawidth contains the physical width of the page. The logical page is usually smaller.

The value of this parameter is used when a page is shipped out and attached to the page. Any modifications of the parameter have no effect to the value stored.

Syntax

The formal description of this primitive is the following:
    ⟨mediawidth⟩
      → ⟨optional prefix⟩ \mediawidth ⟨equals⟩ ⟨dimen value⟩

    ⟨optional prefix⟩
      →
       |  \global ⟨optional prefix⟩ 

Examples

   \mediawidth=210mm 

The Dimen Parameter \mediaheight

The dimen parameter \mediaheight contains the physical height of the page. The logical page is usually smaller.

The value of this parameter is used when a page is shipped out and attached to the page. Any modifications of the parameter have no effect to the value stored.

Syntax

The formal description of this primitive is the following:
    ⟨mediaheight⟩
      → ⟨optional prefix⟩ \mediaheight ⟨equals⟩ ⟨dimen value⟩

    ⟨optional prefix⟩
      →
       |  \global ⟨optional prefix⟩ 

Examples

   \mediaheight=297mm 

The Dimen Parameter \hoffset

The logical page is placed on the physical page such that the upper left corner of the logical page is 1 in down and 1 in to the right of the physical page. This placement can be influence by the dimen parameter \hoffset. The dimen parameter \hoffset contains the horizontal offset added to the reference point when placing the logical page. The default value is 0 pt. Thus the reference point is 1 in to the right. A positive value shifts the reference point rightwards.

The value of this parameter is used when a page is shipped out and attached to the page. Any modifications of the parameter have no effect to the value stored.

Syntax

The formal description of this primitive is the following:
    ⟨hoffset⟩
      → ⟨optional prefix⟩ \hoffset ⟨equals⟩ ⟨dimen value⟩

    ⟨optional prefix⟩
      →
       |  \global ⟨optional prefix⟩ 

Examples

   \hoffset=-.5in 

The Dimen Parameter \voffset

The logical page is placed on the physical page such that the upper left corner of the logical page is 1 in down and 1 in to the right of the physical page. This placement can be influence by the dimen parameter \voffset. The dimen parameter \voffset contains the vertical offset added to the reference point when placing the logical page. The default value is 0 pt. Thus the reference point is 1 in down. A positive value shifts the reference point downwards.

The value of this parameter is used when a page is shipped out and attached to the page. Any modifications of the parameter have no effect to the value stored.

Syntax

The formal description of this primitive is the following:
    ⟨voffset⟩
      → ⟨optional prefix⟩ \voffset ⟨equals⟩ ⟨dimen value⟩

    ⟨optional prefix⟩
      →
       |  \global ⟨optional prefix⟩ 

Examples

   \voffset=1in 

Version:
$Revision: 1.12 $
Author:
Gerd Neugebauer

Constructor Summary
PageFactory()
          Creates a new object.
 
Method Summary
 void enableLogging(java.util.logging.Logger log)
          Setter for the logger.
 Page newInstance(NodeList nodes, Context context, Typesetter typesetter)
          Get a new instance of a page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageFactory

public PageFactory()
Creates a new object.

Method Detail

enableLogging

public void enableLogging(java.util.logging.Logger log)
Description copied from interface: LogEnabled
Setter for the logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
log - the logger to use
See Also:
LogEnabled.enableLogging( java.util.logging.Logger)

newInstance

public Page newInstance(NodeList nodes,
                        Context context,
                        Typesetter typesetter)
                 throws GeneralException
Get a new instance of a page.

Parameters:
nodes - the nodes contained
context - the interpreter context
typesetter - the typesetter
Returns:
the new instance or null if the page would be empty
Throws:
GeneralException - in case of an error