Class: Layout::PageInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb

Overview

This is the interface to a Document‘s paper space information. The paper size and margins, display resolution, and colors can all be accessed and set through this class.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
page_info = doc.page_info
# Get the paper height and width and set the output resolution
width = page_info.width
height = page_info.height
page_info.output_resolution = Layout::PageInfo::RESOLUTION_HIGH

Version:

  • LayOut 2018

Constant Summary collapse

RESOLUTION_HIGH =

Constants

nil
RESOLUTION_LOW =

Stub value.

nil
RESOLUTION_MEDIUM =

Stub value.

nil

Instance Method Summary collapse

Instance Method Details

#bottom_marginNumeric

The #bottom_margin method returns the paper’s bottom margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
bottom_margin = doc.page_info.bottom_margin

Returns:

Version:

  • LayOut 2018



37
38
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 37

def bottom_margin
end

#bottom_margin=(margin) ⇒ Object

The #bottom_margin= method sets the paper’s bottom margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.bottom_margin = 0.40

Parameters:

Raises:

  • (ArgumentError)

    if margin is less than 0 or greater than the page height

Version:

  • LayOut 2018



52
53
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 52

def bottom_margin=(margin)
end

#colorSketchup::Color

The #color method returns the paper’s color.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
paper_color = Layout.page_info.color

Returns:

Version:

  • LayOut 2018



64
65
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 64

def color
end

#color=(new_color) ⇒ Object

The #color= method sets the paper’s color.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.color = Sketchup::Color.new(45, 45, 75, 255)

Parameters:

Version:

  • LayOut 2018



76
77
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 76

def color=(new_color)
end

#display_resolutionInteger

The #display_resolution method returns the on screen rendering resolution quality.

The resolution can be one of the following values:

Layout::PageInfo::RESOLUTION_LOW
Layout::PageInfo::RESOLUTION_MEDIUM
Layout::PageInfo::RESOLUTION_HIGH

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
display_resolution = doc.page_info.display_resolution

Returns:

  • (Integer)

Version:

  • LayOut 2018



94
95
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 94

def display_resolution
end

#display_resolution=(resolution) ⇒ Object

The #display_resolution= method sets the on screen rendering resolution quality.

The resolution can be one of the following values:

Layout::PageInfo::RESOLUTION_LOW
Layout::PageInfo::RESOLUTION_MEDIUM
Layout::PageInfo::RESOLUTION_HIGH

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.display_resolution = Layout::PageInfo::RESOLUTION_MEDIUM

Parameters:

  • resolution (Integer)

Raises:

  • (ArgumentError)

    if resolution is not a valid resolution value

Version:

  • LayOut 2018



114
115
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 114

def display_resolution=(resolution)
end

#heightNumeric

The #height method returns the paper height in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
height = doc.page_info.height

Returns:

Version:

  • LayOut 2018



126
127
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 126

def height
end

#height=(height) ⇒ Object

The #height= method sets the paper height in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.height = 8.5

Parameters:

Raises:

  • (ArgumentError)

    if height is less than 1 or greater than 200

Version:

  • LayOut 2018



140
141
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 140

def height=(height)
end

#left_marginNumeric

The #left_margin method returns the paper’s left margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
left_margin = doc.page_info.left_margin

Returns:

Version:

  • LayOut 2018



152
153
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 152

def left_margin
end

#left_margin=(margin) ⇒ Object

The #left_margin= method sets the paper’s left margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.left_margin = 0.40

Parameters:

Raises:

  • (ArgumentError)

    if margin is less than 0 or greater than the page width

Version:

  • LayOut 2018



167
168
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 167

def left_margin=(margin)
end

#margin_colorSketchup::Color

The #margin_color method returns the color of the paper’s margin.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
margin_color = doc.page_info.margin_color

Returns:

Version:

  • LayOut 2018



179
180
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 179

def margin_color
end

#margin_color=(color) ⇒ Object

The #margin_color= sets the color of paper’s margin.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
new_color = Sketchup::Color("Red")
doc.page_info.margin_color = new_color

Parameters:

Version:

  • LayOut 2018



192
193
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 192

def margin_color=(color)
end

#output_resolutionInteger

The #output_resolution method returns the output rendering resolution quality.

The resolution can be one of the following values:

Layout::PageInfo::RESOLUTION_LOW
Layout::PageInfo::RESOLUTION_MEDIUM
Layout::PageInfo::RESOLUTION_HIGH

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
output_resolution = doc.page_info.output_resolution

Returns:

  • (Integer)

Version:

  • LayOut 2018



210
211
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 210

def output_resolution
end

#output_resolution=(resolution) ⇒ Object

The #output_resolution= method sets the output rendering resolution quality.

The resolution can be one of the following values:

Layout::PageInfo::RESOLUTION_LOW
Layout::PageInfo::RESOLUTION_MEDIUM
Layout::PageInfo::RESOLUTION_HIGH

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.output_resolution = Layout::PageInfo::RESOLUTION_MEDIUM

Parameters:

  • resolution (Integer)

Raises:

  • (ArgumentError)

    if resolution is not a valid resolution value

Version:

  • LayOut 2018



230
231
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 230

def output_resolution=(resolution)
end

The #print_margins= method sets whether to print the paper’s margins.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.print_margins=true

Parameters:

  • print (Boolean)

Version:

  • LayOut 2018



242
243
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 242

def print_margins=(print)
end

The #print_margins? method returns whether to print the paper’s margins.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
margins_printed = doc.page_info.print_margins?

Returns:

  • (Boolean)

Version:

  • LayOut 2018



254
255
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 254

def print_margins?
end

The #print_paper_color= method sets whether or not the page color should be printed.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.print_color = true

Parameters:

  • print_paper_color (Boolean)

Version:

  • LayOut 2018



267
268
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 267

def print_paper_color=(print_paper_color)
end

The #print_paper_color? method returns whether or not the page color should be printed.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
paper_color = doc.page_info.print_paper_color?

Returns:

  • (Boolean)

Version:

  • LayOut 2018



280
281
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 280

def print_paper_color?
end

#right_marginNumeric

The #right_margin method returns the paper’s right margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
right_margin = doc.page_info.right_margin

Returns:

Version:

  • LayOut 2018



292
293
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 292

def right_margin
end

#right_margin=(margin) ⇒ Object

The #right_margin= sets the paper’s right margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.right_margin = 0.40

Parameters:

Raises:

  • (ArgumentError)

    if margin is less than 0 or greater than the page width

Version:

  • LayOut 2018



307
308
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 307

def right_margin=(margin)
end

#show_margins=(margins_visible) ⇒ Object

The #show_margins= method sets whether the paper’s margins are visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.show_margins = false

Parameters:

  • margins_visible (Boolean)

Version:

  • LayOut 2018



319
320
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 319

def show_margins=(margins_visible)
end

#show_margins?Boolean

The #show_margins? method returns whether the paper’s margins are visible.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
show_margins = doc.page_info.show_margins?

Returns:

  • (Boolean)

Version:

  • LayOut 2018



331
332
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 331

def show_margins?
end

#top_marginNumeric

The #top_margin method returns the paper’s top margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
top_margin = doc.page_info.top_margin

Returns:

Version:

  • LayOut 2018



343
344
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 343

def top_margin
end

#top_margin=(margin) ⇒ Object

The #top_margin method sets the paper’s top margin in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.top_margin = 0.40

Parameters:

Raises:

  • (ArgumentError)

    if margin is less than 0 or greater than the page height

Version:

  • LayOut 2018



358
359
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 358

def top_margin=(margin)
end

#widthNumeric

The #width method returns the paper width in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
width = doc.page_info.width

Returns:

Version:

  • LayOut 2018



370
371
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 370

def width
end

#width=(width) ⇒ Object

The #width= method sets the paper width in document units.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
doc.page_info.width = 8.5

Parameters:

Raises:

  • (ArgumentError)

    if width is less than 1 or greater than 200

Version:

  • LayOut 2018



384
385
# File 'lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb', line 384

def width=(width)
end