def store_setup   #:nodoc:
    record       = 0x00A1                  # Record identifier
    length       = 0x0022                  # Number of bytes to follow

    iPaperSize   = @paper_size    # Paper size
    iScale       = @print_scale   # Print scaling factor
    iPageStart   = @page_start    # Starting page number
    iFitWidth    = @fit_width     # Fit to number of pages wide
    iFitHeight   = @fit_height    # Fit to number of pages high
    grbit        = 0x00           # Option flags
    iRes         = 0x0258         # Print resolution
    iVRes        = 0x0258         # Vertical print resolution
    numHdr       = @margin_header # Header Margin
    numFtr       = @margin_footer # Footer Margin
    iCopies      = 0x01           # Number of copies

    fLeftToRight = @page_order    # Print over then down
    fLandscape   = @orientation   # Page orientation
    fNoPls       = 0x0                     # Setup not read from printer
    fNoColor     = @black_white   # Print black and white
    fDraft       = @draft_quality # Print draft quality
    fNotes       = @print_comments# Print notes
    fNoOrient    = 0x0            # Orientation not set
    fUsePage     = @custom_start  # Use custom starting page

    grbit           = fLeftToRight
    grbit          |= fLandscape    << 1
    grbit          |= fNoPls        << 2
    grbit          |= fNoColor      << 3
    grbit          |= fDraft        << 4
    grbit          |= fNotes        << 5
    grbit          |= fNoOrient     << 6
    grbit          |= fUsePage      << 7


    numHdr = [numHdr].pack('d')
    numFtr = [numFtr].pack('d')

    if @byte_order
      numHdr.reverse!
      numFtr.reverse!
    end

    header = [record, length].pack('vv')
    data1  = [iPaperSize, iScale, iPageStart,
              iFitWidth, iFitHeight, grbit, iRes, iVRes].pack("vvvvvvvv")

    data2  = numHdr + numFtr
    data3  = [iCopies].pack('v')

    prepend(header, data1, data2, data3)

  end
def store_setup   #:nodoc:
    record       = 0x00A1                  # Record identifier
    length       = 0x0022                  # Number of bytes to follow

    iPaperSize   = @paper_size    # Paper size
    iScale       = @print_scale   # Print scaling factor
    iPageStart   = @page_start    # Starting page number
    iFitWidth    = @fit_width     # Fit to number of pages wide
    iFitHeight   = @fit_height    # Fit to number of pages high
    grbit        = 0x00           # Option flags
    iRes         = 0x0258         # Print resolution
    iVRes        = 0x0258         # Vertical print resolution
    numHdr       = @margin_header # Header Margin
    numFtr       = @margin_footer # Footer Margin
    iCopies      = 0x01           # Number of copies

    fLeftToRight = @page_order    # Print over then down
    fLandscape   = @orientation   # Page orientation
    fNoPls       = 0x0                     # Setup not read from printer
    fNoColor     = @black_white   # Print black and white
    fDraft       = @draft_quality # Print draft quality
    fNotes       = @print_comments# Print notes
    fNoOrient    = 0x0            # Orientation not set
    fUsePage     = @custom_start  # Use custom starting page

    grbit           = fLeftToRight
    grbit          |= fLandscape    << 1
    grbit          |= fNoPls        << 2
    grbit          |= fNoColor      << 3
    grbit          |= fDraft        << 4
    grbit          |= fNotes        << 5
    grbit          |= fNoOrient     << 6
    grbit          |= fUsePage      << 7


    numHdr = [numHdr].pack('d')
    numFtr = [numFtr].pack('d')

    if @byte_order
      numHdr.reverse!
      numFtr.reverse!
    end

    header = [record, length].pack('vv')
    data1  = [iPaperSize, iScale, iPageStart,
              iFitWidth, iFitHeight, grbit, iRes, iVRes].pack("vvvvvvvv")

    data2  = numHdr + numFtr
    data3  = [iCopies].pack('v')

    prepend(header, data1, data2, data3)

  end
Store the page setup SETUP BIFF record.