Sha256: d0027bca496239e488a4f5501d266df48a0d18ae455f4a0cee12f5db727b0b9e

Contents?: true

Size: 1.86 KB

Versions: 2

Compression:

Stored size: 1.86 KB

Contents

module Asposepdfjava
  module SetDocumentWindow
    def initialize()
    	# The path to the documents directory.
        data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
        
        # Open a pdf document.
        doc = Rjb::import('com.aspose.pdf.Document').new(data_dir + "input1.pdf")

        # Set different document properties
        # Position of document's window - Default: false
        doc.setCenterWindow(true)

        # Predominant reading order; determine the position of page
        # when displayed side by side - Default: L2R
        doc.setDirection(Rjb::import('com.aspose.pdf.Direction.R2L'))

        # Whether window's title bar should display document title.
        # If false, title bar displays PDF file name - Default: false
        doc.setDisplayDocTitle(true)

        # Whether to resize the document's window to fit the size of
        # first displayed page - Default: false
        doc.setFitWindow(true)

        # Whether to hide menu bar of the viewer application - Default: false
        doc.setHideMenubar(true)

        # Whether to hide tool bar of the viewer application - Default: false
        doc.setHideToolBar(true)

        # Whether to hide UI elements like scroll bars
        # and leaving only the page contents displayed - Default: false
        doc.setHideWindowUI(true)

        # The document's page mode. How to display document on exiting full-screen mode.
        doc.setNonFullScreenPageMode(Rjb::import('com.aspose.pdf.PageMode.UseOC'))

        # The page layout i.e. single page, one column
        doc.setPageLayout(Rjb::import('com.aspose.pdf.PageLayout.TwoColumnLeft'))

        #How the document should display when opened.
        doc.setPageMode()

        # Save updated PDF file
        doc.save("Set Document Window.pdf")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asposepdfjava-0.0.2 lib/asposepdfjava/Document/setdocumentwindow.rb
asposepdfjava-0.0.1 lib/asposepdfjava/Document/setdocumentwindow.rb