Class PDF::Writer::Object::ViewerPreferences
In: lib/pdf/writer/object/viewerpreferences.rb
Parent: PDF::Writer::Object
Transaction::Simple SimpleTable TechBook Complex Action Procset FontDescriptor FontEncoding Destination Info Catalog Encryption Contents Pages Outline Outlines Annotation Page Font ViewerPreferences Image Hash OHash QuickRef FontMetrics ARC4 StrokeStyle PolygonPoint ImageInfo StdDev lib/pdf/simpletable.rb lib/pdf/techbook.rb lib/pdf/writer.rb lib/pdf/quickref.rb Math lib/pdf/writer/fontmetrics.rb lib/pdf/writer/ohash.rb lib/pdf/writer/arc4.rb lib/pdf/writer/strokestyle.rb lib/pdf/writer/graphics.rb lib/pdf/writer/object.rb lib/pdf/writer/object/image.rb External EN Lang OffsetReader lib/pdf/writer/graphics/imageinfo.rb Graphics lib/pdf/writer/object/outlines.rb lib/pdf/writer/object/destination.rb lib/pdf/writer/object/viewerpreferences.rb lib/pdf/writer/object/fontencoding.rb lib/pdf/writer/object/page.rb lib/pdf/writer/object/contents.rb lib/pdf/writer/object/procset.rb lib/pdf/writer/object/pages.rb lib/pdf/writer/object/info.rb lib/pdf/writer/object/encryption.rb lib/pdf/writer/object/catalog.rb lib/pdf/writer/object/outline.rb lib/pdf/writer/object/fontdescriptor.rb lib/pdf/writer/object/action.rb lib/pdf/writer/object/font.rb lib/pdf/writer/object/annotation.rb Object Writer lib/pdf/charts/stddev.rb Charts PDF dot/m_33_0.png

Set the viewer preferences.

HideToolbar:boolean (Optional) A flag specifying whether to hide the viewer application? tool bars when the document is active. Default value: false.
HideMenubar:boolean (Optional) A flag specifying whether to hide the viewer application? menu bar when the document is active. Default value: false.
HideWindowUI:boolean (Optional) A flag specifying whether to hide user interface elements in the document? window (such as scroll bars and navigation controls), leaving only the document? contents displayed. Default value: false.
FitWindow:boolean (Optional) A flag specifying whether to resize the document? window to fit the size of the first displayed page. Default value: false.
CenterWindow:boolean (Optional) A flag specifying whether to position the document? window in the center of the screen. Default value: false.
NonFullScreenPageMode:name (Optional) The document? page mode, specifying how to display the document on exiting full-screen mode. This entry is meaningful only if the value of the PageMode entry in the catalog dictionary is FullScreen; it is ignored otherwise. Default value: UseNone.
Direction:name (Optional; PDF 1.3) The predominant reading order for text: L2R Left to right R2L Right to left (including vertical writing systems such as Chinese, Japanese, and Korean) This entry has no direct effect on the document? contents or page numbering, but can be used to determine the relative positioning of pages when displayed side by side or printed n-up. Default value: L2R.

NonFullScreenPageMode Names

UseNone:Neither document outline nor thumbnail images visible
UseOutlines:Document outline visible
UseThumbs:Thumbnail images visible

Note that boolean values are represented by the values ‘true’ and ‘false’. Also note that I have not done much testing on changing these values and am not sure how responsive the various viewers and browsers are to them (and setting the direction would be fairly meaningless as none of these character sets are avaliable yet.

Methods

new   to_s  

Constants

Preferences = %w{HideToolbar HideMenubar HideWindowUI FitWindow CenterWindow NonFullScreenPageMode Direction}

Public Class methods

[Source]

    # File lib/pdf/writer/object/viewerpreferences.rb, line 58
58:   def initialize(parent)
59:     super(parent)
60:   end

Public Instance methods

[Source]

    # File lib/pdf/writer/object/viewerpreferences.rb, line 66
66:   def to_s
67:     res = "\n#{@id} 0 obj\n<< "
68:     Preferences.each do |s|
69:       v = __send__("#{s.downcase}".intern)
70:       res << "\n/#{s} /#{v}" unless v.nil?
71:     end
72:     res << "\n>>\n"
73:   end

[Validate]