source/text/sbasic/shared/03/sf_base.xhp     |   65 +++++++++++++++++++++++--
 source/text/sbasic/shared/03/sf_document.xhp |   70 +++++++++++++++++++++++++--
 source/text/sbasic/shared/03/sf_writer.xhp   |    9 ++-
 3 files changed, 133 insertions(+), 11 deletions(-)

New commits:
commit 60560093b76da08195ad1b1dc7bbd17ee2cfb333
Author:     Alain Romedenne <alain.romede...@libreoffice.org>
AuthorDate: Wed Oct 27 10:33:15 2021 +0200
Commit:     Rafael Lima <rafael.palma.l...@gmail.com>
CommitDate: Wed Nov 10 14:24:41 2021 +0100

    New methods in sf_Base, (sf_Calc,) sf_Doc. and sf_Writer services
    
    - PrintOut
    - SetPrinter
    
    Change-Id: I809797247ce50c9a74ec8c1c703722911c687993
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124194
    Tested-by: Jenkins
    Reviewed-by: Rafael Lima <rafael.palma.l...@gmail.com>

diff --git a/source/text/sbasic/shared/03/sf_base.xhp 
b/source/text/sbasic/shared/03/sf_base.xhp
index d78a60854..16c0f61a1 100644
--- a/source/text/sbasic/shared/03/sf_base.xhp
+++ b/source/text/sbasic/shared/03/sf_base.xhp
@@ -36,7 +36,6 @@
         <paragraph id="par_id421619032296454" role="listitem">Check if a form 
document from a Base document is currently loaded.</paragraph>
     </listitem>
 </list>
-  <embed href="text/sbasic/shared/03/avail_release.xhp#7.2.service"/>
 </section>
 
   <tip id="par_id241619032941497">Refer to the <link 
href="text/sbasic/shared/03/sf_document.xhp" name="Document 
Service"><literal>Document</literal> service</link> to learn more about methods 
and properties that can be used to manage %PRODUCTNAME documents.</tip>
@@ -85,18 +84,20 @@
            <paragraph id="par_id981619034669263" role="tablecontent" 
localize="false">
              <link href="text/sbasic/shared/03/sf_base.xhp#CloseFormDocument" 
name="CloseFormDocument method">CloseFormDocument</link><br/>
              <link href="text/sbasic/shared/03/sf_base.xhp#FormDocuments" 
name="FormDocuments method">FormDocuments</link><br/>
+             <link href="text/sbasic/shared/03/sf_base.xhp#Forms" name="Forms 
method">Forms</link><br/>
            </paragraph>
        </tablecell>
        <tablecell>
            <paragraph id="par_id721619034669263" role="tablecontent" 
localize="false">
-             <link href="text/sbasic/shared/03/sf_base.xhp#Forms" name="Forms 
method">Forms</link><br/>
              <link href="text/sbasic/shared/03/sf_base.xhp#GetDatabase" 
name="GetDatabase method">GetDatabase</link><br/>
+             <link href="text/sbasic/shared/03/sf_base.xhp#IsLoaded" 
name="IsLoaded method">IsLoaded</link><br/>
+             <link href="text/sbasic/shared/03/sf_base.xhp#OpenFormDocument" 
name="OpenFormDocument method">OpenFormDocument</link><br/>
            </paragraph>
        </tablecell>
        <tablecell>
            <paragraph id="par_id711619034669263" role="tablecontent" 
localize="false">
-             <link href="text/sbasic/shared/03/sf_base.xhp#IsLoaded" 
name="IsLoaded method">IsLoaded</link><br/>
-             <link href="text/sbasic/shared/03/sf_base.xhp#OpenFormDocument" 
name="OpenFormDocument method">OpenFormDocument</link><br/>
+             <link href="text/sbasic/shared/03/sf_base.xhp#PrintOut" 
name="PrintOut method">PrintOut</link><br/>
+             <link href="text/sbasic/shared/03/sf_base.xhp#SetPrinter" 
name="SetPrinter method">SetPrinter</link><br/><br/>
            </paragraph>
        </tablecell>
    </tablerow>
@@ -301,6 +302,62 @@
   </pycode>
 </section>
 
+<section id="PrintOut">
+  <comment> PrintOut 
---------------------------------------------------------------- </comment>
+  <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id721985200121249">
+    <bookmark_value>Base service;PrintOut</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id261589202101415" localize="false">PrintOut</h2>
+  <paragraph role="paragraph" id="par_id156589200121138">This method sends the 
content of the given form document to a default printer or a printer defined by 
the <literal>SetPrinter()</literal> method.</paragraph>
+  <paragraph role="paragraph" id="par_id981611169416934">Returns 
<literal>True</literal> if the document was successfully printed.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+  <paragraph role="paragraph" localize="false" id="par_id1001622827822169">
+    <input>svc.PrintOut(opt formdocument: str, pages: str = "", copies: num = 
1): bool</input>
+  </paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+  <paragraph role="paragraph" 
id="par_id368519200121646"><emph>formdocument</emph>: A valid document form 
name as a case-sensitive string. The form document must be open. It is 
activated by the method.</paragraph>
+  <paragraph role="paragraph" id="par_id211635436910093"><emph>pages</emph>: 
The pages to print as a string, like in the user interface. Example: 
&quot;1-4;10;15-18&quot;. Default is all pages.</paragraph>
+  <paragraph role="paragraph" 
id="par_id141635436912146"><emph>copies</emph><emph></emph>: The number of 
copies. Default is 1.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id891589200121516">If 
oDoc.PrintOut("myForm", "1-4;10;15-18", Copies := 2) Then</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id515892500606125">    
' ...</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id751682227903730">End 
If</paragraph>
+  </bascode>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <pycode>
+    <paragraph role="pycode" localize="false" id="pyc_id731622728946898">if 
doc.PrintOut('myForm', copies=3, pages='45-88'):</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id221628227947414">    # 
...</paragraph>
+  </pycode>
+</section>
+
+<section id="SetPrinter">
+  <comment> SetPrinter 
------------------------------------------------------------------- </comment>
+  <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id71158921504765">
+    <bookmark_value>Base service;SetPrinter</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id811589502147824" localize="false">SetPrinter</h2>
+  <paragraph role="paragraph" id="par_id911298505147502">Define the printer 
options for a form document. The form document must be open.</paragraph>
+  <paragraph role="paragraph" id="par_id381651114800685">Returns 
<literal>True</literal> when successful.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+  <paragraph role="paragraph" localize="false" id="par_id261652828596855">
+    <input>svc.SetPrinter(opt formdocument: str, opt printer: str, opt 
orientation: str, paperformat: str): bool</input>
+  </paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+  <paragraph role="paragraph" 
id="par_id961635950394507"><emph>formdocument</emph>: A valid document form 
name as a case-sensitive string.</paragraph>
+  <embed href="text/sbasic/shared/03/sf_document.xhp#setPrinterArgs"/>
+  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <bascode>
+    <paragraph role="bascode" localize="false" 
id="bas_id431589204157164">oDoc.SetPrinter("myForm", Orientation := 
"PORTRAIT")</paragraph>
+  </bascode>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <pycode>
+    <paragraph role="pycode" localize="false" 
id="pyc_id941628229095519">doc.SetPrinter('myForm', 
paperformat='TABLOID')</paragraph>
+  </pycode>
+</section>
+
   <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
   <section id="relatedtopics">
     <embed href="text/sbasic/shared/03/sf_database.xhp#DatabaseService"/>
diff --git a/source/text/sbasic/shared/03/sf_document.xhp 
b/source/text/sbasic/shared/03/sf_document.xhp
index c4e0bafd2..778e612a8 100644
--- a/source/text/sbasic/shared/03/sf_document.xhp
+++ b/source/text/sbasic/shared/03/sf_document.xhp
@@ -294,18 +294,20 @@
            <paragraph id="par_id761611086279902" role="tablecontent" 
localize="false">
              <link href="text/sbasic/shared/03/sf_document.xhp#Activate" 
name="Activate method">Activate</link><br/>
              <link href="text/sbasic/shared/03/sf_document.xhp#CloseDocument" 
name="CloseDocument method">CloseDocument</link><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#PrintOut" 
name="PrintOut method">PrintOut</link><br/>
            </paragraph>
        </tablecell>
        <tablecell>
            <paragraph id="par_id141611086279902" role="tablecontent" 
localize="false">
              <link href="text/sbasic/shared/03/sf_document.xhp#RunCommand" 
name="RunCommand method">RunCommand</link><br/>
-             <link href="text/sbasic/shared/03/sf_document.xhp#Save" 
name="Save method">Save</link><br/><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#Save" 
name="Save method">Save</link><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#SaveAs" 
name="SaveAs method">SaveAs</link><br/>
            </paragraph>
        </tablecell>
        <tablecell>
            <paragraph id="par_id761611086279903" role="tablecontent" 
localize="false">
-             <link href="text/sbasic/shared/03/sf_document.xhp#SaveAs" 
name="SaveAs method">SaveAs</link><br/>
-             <link href="text/sbasic/shared/03/sf_document.xhp#SaveCopyAs" 
name="SaveCopyAs">SaveCopyAs</link><br/><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#SaveCopyAs" 
name="SaveCopyAs method">SaveCopyAs</link><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#SetPrinter" 
name="SetPrinter method">SetPrinter</link><br/><br/>
            </paragraph>
        </tablecell>
    </tablerow>
@@ -349,7 +351,7 @@
   <paragraph role="paragraph" id="par_id341611149562894">The method will also 
return <literal>False</literal> if the user declines to close it.</paragraph>
   <paragraph role="paragraph" id="par_id981611149616934">Returns 
<literal>True</literal> if the document was successfully closed.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
-  <paragraph role="paragraph" localize="false" id="par_id1001622827822169">
+  <paragraph role="paragraph" localize="false" id="par_id1001622887222169">
     <input>svc.CloseDocument(saveask: bool = True): bool</input>
   </paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
@@ -357,7 +359,7 @@
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
   <bascode>
-    <paragraph role="bascode" localize="false" id="bas_id891589200121516">If 
oDoc.CloseDocument(True) Then</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id891580290121516">If 
oDoc.CloseDocument(True) Then</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id51589200506125">    ' 
...</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id751622827903730">End 
If</paragraph>
   </bascode>
@@ -368,6 +370,35 @@
   </pycode>
 </section>
 
+<section id="PrintOut">
+  <comment> PrintOut 
---------------------------------------------------------------- </comment>
+  <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id721985200121249">
+    <bookmark_value>Document service;PrintOut</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id261589202101415" localize="false">PrintOut</h2>
+  <paragraph role="paragraph" id="par_id156589200121138">This method sends the 
content of the document to a default printer or a printer defined by the 
<literal>SetPrinter</literal> method.</paragraph>
+  <paragraph role="paragraph" id="par_id981611169416934">Returns 
<literal>True</literal> if the document was successfully printed.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+  <paragraph role="paragraph" localize="false" id="par_id1001622827822169">
+    <input>svc.PrintOut(pages: str = "", copies: num = 1): bool</input>
+  </paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+  <paragraph role="paragraph" id="par_id211635436910093"><emph>pages</emph>: 
The pages to print as a string, like in the user interface. Example: 
&quot;1-4;10;15-18&quot;. Default is all pages.</paragraph>
+  <paragraph role="paragraph" 
id="par_id141635436912146"><emph>copies</emph><emph></emph>: The number of 
copies. Default is 1.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id891589200121516">If 
oDoc.PrintOut("1-4;10;15-18", Copies := 2) Then</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id515892500606125">    
' ...</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id751682227903730">End 
If</paragraph>
+  </bascode>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <pycode>
+    <paragraph role="pycode" localize="false" id="pyc_id731622728946898">if 
doc.PrintOut(copies=3, pages='45-88'):</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id221628227947414">    # 
...</paragraph>
+  </pycode>
+</section>
+
 <section id="RunCommand">
   <comment> RunCommand 
--------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id601589202413561">
@@ -486,6 +517,35 @@
   </pycode>
 </section>
 
+<section id="SetPrinter">
+  <comment> SetPrinter 
------------------------------------------------------------------- </comment>
+  <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id71158921504765">
+    <bookmark_value>Document service;SetPrinter</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id811589502147824" localize="false">SetPrinter</h2>
+  <paragraph role="paragraph" id="par_id911298505147502">Defines the printer 
options for the document.</paragraph>
+  <paragraph role="paragraph" id="par_id381651114800685">Returns 
<literal>True</literal> when successful.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+  <paragraph role="paragraph" localize="false" id="par_id261652828596855">
+    <input>svc.SetPrinter(opt printer: str, opt orientation: str, paperformat: 
str): bool</input>
+  </paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+  <section id="setPrinterArgs">
+    <paragraph role="paragraph" 
id="par_id301589205741697"><emph>printer</emph>: The name of the printer queue 
where to print to. When absent, the default printer is set.</paragraph>
+    <paragraph role="paragraph" 
id="par_id851985205147348"><emph>orientation</emph>: Either 
<literal>PORTRAIT</literal> or <literal>LANDSCAPE</literal>. When absent, left 
unchanged with respect to the printer settings.</paragraph>
+    <paragraph role="paragraph" 
id="par_id821985205147330"><emph>paperformat</emph>: One of the following 
string values <literal>A3</literal>, <literal>A4</literal>, 
<literal>A5</literal>, <literal>LETTER</literal>, <literal>LEGAL</literal>, 
<literal>TABLOID</literal>. Left unchanged when absent.</paragraph>
+  </section>
+  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <bascode>
+    <paragraph role="bascode" localize="false" 
id="bas_id431589204157164">oDoc.SetPrinter(Orientation := 
"PORTRAIT")</paragraph>
+  </bascode>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <pycode>
+    <paragraph role="pycode" localize="false" 
id="pyc_id941628229095519">doc.SetPrinter(paperformat='TABLOID')</paragraph>
+  </pycode>
+</section>
+
   <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
   <section id="relatedtopics">
     <embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
diff --git a/source/text/sbasic/shared/03/sf_writer.xhp 
b/source/text/sbasic/shared/03/sf_writer.xhp
index 5b29bf5d0..4744e3175 100644
--- a/source/text/sbasic/shared/03/sf_writer.xhp
+++ b/source/text/sbasic/shared/03/sf_writer.xhp
@@ -32,7 +32,6 @@
       <comment>TBD</comment>
     </list>
 </section>
-    <embed href="text/sbasic/shared/03/avail_release.xhp#7.3.service"/>
 
   <h2 id="hd_id581582885621841">Service invocation</h2>
     <paragraph role="paragraph" id="par_id591589191059889" 
xml-lang="en-US">The <literal>Writer</literal> service is closely related to 
the <literal>UI</literal> service of the <literal>ScriptForge</literal> 
library. Below are a few examples of how the <literal>Writer</literal> service 
can be invoked.</paragraph>
@@ -157,13 +156,19 @@
       <bookmark_value>Writer service;PrintOut</bookmark_value>
   </bookmark>
   <h2 id="hd_id921592919577158" localize="false">PrintOut</h2>
-  <paragraph role="paragraph" id="par_id31592919577984">Send the content of 
the document to the printer. The printer might be defined previously by 
default, by the user or by the SetPrinter() method. Returns 
<literal>True</literal> when successful.</paragraph>
+  <paragraph role="paragraph" id="par_id31592919577984">Send the content of 
the document to the printer. The printer might be defined previously by 
default, by the user or by the <link 
href="text/sbasic/03/sf_document.xhp#SetPrinter" name="SetPrinter 
method"><literal>SetPrinter()</literal></link> method of the <link 
href="text/sbasic/03/sf_document.xhp" name="Document service">Document</link> 
service. Returns <literal>True</literal> when successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" localize="false" id="par_id441621534763020">
     <input>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</input>
   </paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
   <paragraph role="paragraph" id="par_id441592919577809"><emph>pages</emph>: 
The pages to print as a string, like in the user interface. Example: 
&quot;1-4;10;15-18&quot;. Default = all pages</paragraph>
+  <paragraph role="paragraph" id="par_id221636020923278"><emph>copies</emph>: 
The number of copies, default is 1.</paragraph>
+  <paragraph role="paragraph" 
id="par_id121636020926764"><emph>printbackground</emph>: Prints the background 
image when <literal>True</literal> (default).</paragraph>
+  <paragraph role="paragraph" 
id="par_id261636020927276"><emph>printblankpages</emph>: When 
<literal>False</literal> (default), omits empty pages.</paragraph>
+  <paragraph role="paragraph" 
id="par_id021636020927484"><emph>printevenpages</emph>: Prints even pages when 
<literal>True</literal> (default).</paragraph>
+  <paragraph role="paragraph" 
id="par_id391636020927676"><emph>printoddpages</emph>: Print odd pages when 
<literal>True</literal> (default).</paragraph>
+  <paragraph role="paragraph" 
id="par_id121636021103996"><emph>printimages</emph>: Print graphic objects when 
<literal>True</literal> (default).</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
   <bascode>

Reply via email to