123456789_123456789_123456789_123456789_123456789_

Class: Layout::PageInfo

Relationships
Inherits: Object

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

Instance Attribute Summary

Instance Attribute Details

#bottom_marginNumeric (rw)

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

Version:

  • LayOut 2018

#bottom_margin=(margin) (rw)

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

#colorSketchup::Color (rw)

The #color method returns the paper’s color.

Examples:

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

Version:

  • LayOut 2018

#color=(new_color) (rw)

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

#display_resolutionInteger (rw)

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

Version:

  • LayOut 2018

#display_resolution=(resolution) (rw)

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

#heightNumeric (rw)

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

Version:

  • LayOut 2018

#height=(height) (rw)

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

#image_display_resolutionInteger (rw)

The #image_display_resolution method returns the on screen image 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")
image_quality = doc.page_info.image_display_resolution

Version:

  • LayOut 2023.1

#image_display_resolution=(resolution) (rw)

The #image_display_resolution= method sets the on screen image 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.image_display_resolution = Layout::PageInfo::RESOLUTION_LOW

Parameters:

  • resolution (Integer)

Raises:

  • (ArgumentError)

    if resolution is not a valid resolution value

Version:

  • LayOut 2023.1

#image_output_resolutionInteger (rw)

The #image_output_resolution method returns the output image 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")
image_quality = doc.page_info.image_output_resolution

Version:

  • LayOut 2023.1

#image_output_resolution=(resolution) (rw)

The #image_output_resolution= method sets the output image 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.image_output_resolution = Layout::PageInfo::RESOLUTION_HIGH

Parameters:

  • resolution (Integer)

Raises:

  • (ArgumentError)

    if resolution is not a valid resolution value

Version:

  • LayOut 2023.1

#left_marginNumeric (rw)

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

Version:

  • LayOut 2018

#left_margin=(margin) (rw)

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

#margin_colorSketchup::Color (rw)

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

Version:

  • LayOut 2018

#margin_color=(color) (rw)

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

#output_resolutionInteger (rw)

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

Version:

  • LayOut 2018

#output_resolution=(resolution) (rw)

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

#right_marginNumeric (rw)

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

Version:

  • LayOut 2018

#right_margin=(margin) (rw)

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

#show_margins=(margins_visible) (rw)

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

#show_margins?Boolean (rw)

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?

Version:

  • LayOut 2018

#top_marginNumeric (rw)

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

Version:

  • LayOut 2018

#top_margin=(margin) (rw)

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

#widthNumeric (rw)

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

Version:

  • LayOut 2018

#width=(width) (rw)

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