Friday, September 11, 2020

Soffice from Command Line - MAN Pages



libreoffice - LibreOffice office suite


libreoffice [--accept=accept-string] [--base] [--calc] [--convert-to output_file_extension[:output_filter_name] [--outdir output_dir] file]... [--display display] [--draw] [--global] [--headless] [--help|-h|-?] [--impress] [--invisible] [--infilter="<filter>"] [--math] [--minimized] [-n file]... [--nodefault] [--nolockcheck] [--nologo] [--norestore] [-o file]... [-p file...] [--print-to-file [--printer-name printer_name] [--outdir output_dir] file]... [--pt printername file...] [--show Impress file]... [--unaccept=accept-string] [--terminate_after_init] [--view file]... [--web] [--writer] [file...]


LibreOffice (LO for short) is a multi-platform office productivity suite. It was derived from 3.3 Beta on September 28, 2010.

libreoffice is a shell script that sets up the environment and passes the command line arguments to the soffice.bin binary.

Alternatively, the following helper scripts start the respective module:

sbase, scalc, sdraw, simpress, smath, sofficerc, swriter


Specify a UNO connect-string to create a UNO acceptor through which other programs can connect to access the API.
Starts the wizard for a new Base document.
Starts with a new Calc document.
--convert-to output_file_extension[:output_filter_name] [--outdir output_dir] file...
Batch converts files. If --outdir is not specified then the current working directory is used as the output directory for the converted files. It implies --headless.


--convert-to pdf *.doc

Converts all .doc files to PDFs.

--convert-to pdf:writer_pdf_Export --outdir /home/user *.doc

Converts all .doc files to PDFs using the settings in the Writer PDF export dialog and saving them in /home/user.

--display display
This option specifies the X server to use; see X(7)
Starts with a new Draw document.
Starts with a new Global document.
Starts in "headless mode", which allows using the application without user a interface.

This special mode can be used when the application is controlled by external clients via the API.

It implies --invisible and strictly ignores any GUI environment. --quickstart does not work with this parameter.

Lists LibreOffice command line parameters.
Starts with a new Impress document.
Starts in invisible mode.

Neither the start-up logo nor the initial program window will be visible. LO can be controlled and documents and dialogs can be opened via the API.

When started with this parameter, it can only be quit using the taskmanager (Windows) or the kill command (UNIX based systems).

--quickstart does not work with this parameter.

Force an input filter type if possible. For example --infilter="Calc Office Open XML" only
Starts with a new Math document.
Keeps the splash screen minimized.
-n template...
Creates the a new document from the given templates.
Starts LO without creating a new document. The next time you start LO, the welcome screen is shown.

It's used together with --nologo by quick starters. Note that --quickstart has no longer been supported since 2.0.0.

Disables the check for remote instances using the installation.
Disables the splash screen at program start.
Disables restart and file recovery after a system crash. It is possible that LO will try to restore a file it keeps crashing on, if that happens --norestore is the only way to start LO.
Disables the splash screen at program start.
-o file...
Opens the given files for editing, even templates.

Without -o a template file would create a new document derived from that template.

-p file...
Prints the given files to the default printer and ends. The splash screen does not appear.

If the file name contains spaces, then it must be enclosed in quotation marks.

--print-to-file [--printer-name printer_name] [--outdir output_dir] file...
Batch print files to file. If --printer-name is not specified the default printer is used. If --outdir is not specified then the current working directory is used as the output directory for the converted files.


--print-to-file *.doc

Prints all .doc files to the current working directory using the default printer.

--print-to-file --printer-name nasty_lowres_printer --outdir /home/user *.doc

Prints all .doc files to /home/user directory using the nasty_lowres_printer.

--pt printername file...
Prints the given files to the printer printername and ends. The splash screen does not appear.

If a file name contains spaces, then it must be enclosed in quotation marks.

--quickstart --quickstart=no
Starts LO with it's quick starter. --quickstart disable the quick starter.

Does not work with --invisible or --headless.

--show Impress file...
Opens the given Impress files, starts the presentation and quits after they have finished.
Closes an acceptor that was created with --accept option.

Use --unaccept=all to close all open acceptors.

Starts LO and terminates after it registers some UNO services. Doesn't show the splash during startup.
--view file...
Opens the given files read-only creating a temporary copy of them at $TMPDIR.
Starts with a new HTML document.
Starts with a new Writer document.

Monday, March 16, 2020

Links with %GDWORD% variable for Goldendict

TAUS DE-RO[yourEmail]&auth_password=[yourpassword]
Bing Search Text
Bing Search Images
Microsoft Terminology EN-RO
Microsoft Terminology EN-DE
Linguee DICT DE-EN
Linguee DICT EN-DE
Linguee DICT DE-RO
Linguee Heroku EN-DE
Linguee RO-GE
Linguee EN-RO
Glosbe Autosuggest
Proz DE-RO

Google search
Yandex APItranslate ALL-RO[key]&text=%GDWORD%&lang=de&format=plain&options=1
Yandex APItranslate DE-RO[key]&text=%GDWORD%&lang=de-ro&format=html&options=1
Yandex WEBtranslate DE-RO
Babelfish DE-RO

Babelfish MT DE-RO
Babelfish MT AUTO-RO
Hallo DE-RO
Hallo EN-RO
Mymemory EN-RO
Mymemory DE-RO
Dictindustry DE-EN
Dictindustry DE-ROänisch/%GDWORD% ENRO RO-EN EN-EN API

EuroTermBank JSON
EuroTermBank JSON ALT

Name Link

Monday, March 9, 2020

Dictionar Forestier Poliglot – Multilingual Forestry Dictionary – Dictionnaire Forestier Polyglotte – Wörterbuch der Forstwirtschaft

This is a sample of the forestry multilingual dictionary containing terms in Romanian, English, French and German. The full dictionary contains 195 pages and may be bought as PDF.


Tuesday, March 3, 2020

Encode and decode URLs in Python 3

>>> import urllib.parse >>> query = 'Hellö Wörld@Python' >>> urllib.parse.quote(query) 'Hell%C3%B6%20W%C3%B6rld%40Python'
Note that, the quote() function considers / character safe by default. That means, It doesn’t encode / character -
>> urllib.parse.quote('/') '/'
The quote() function accepts a named parameter called safe whose default value is /. If you want to encode / character as well, then you can do so by supplying an empty string in the safe parameter like this-
>>> urllib.parse.quote('/', safe='') '%2F'

The quote() function encodes space characters to %20. If you want to encode space characters to plus sign (+), then you can use another function named quote_plus provided by urllib.parse package.
>>> import urllib.parse >>> query = 'Hellö Wörld@Python' >>> urllib.parse.quote_plus(query) 'Hell%C3%B6+W%C3%B6rld%40Python'

Encoding multiple parameters at once
You can encode multiple parameters at once using urllib.parse.urlencode() function. This is a convenience function which takes a dictionary of key value pairs or a sequence of two-element tuples and uses the quote_plus() function to encode every value. The resulting string is a series of key=value pairs separated by & character.
Let’s see an example -
>>> import urllib.parse >>> params = {'q': 'Python URL encoding', 'as_sitesearch': ''} >>> urllib.parse.urlencode(params) 'q=Python+URL+encoding&'
If you want the urlencode() function to use the quote() function for encoding parameters, then you can do so like this -
urllib.parse.urlencode(params, quote_via=urllib.parse.quote)
Encoding multiple parameters at once where one parameter can have multiple values
The urlencode() function takes an optional argument called doseq. If your input can have multiple values for a single key, then you should set the doseq argument to True so that all the values are encoded properly -
>>> import urllib.parse >>> params = {'name': 'Rajeev Singh', 'phone': ['+919999999999', '+628888888888']} >>> urllib.parse.urlencode(params, doseq=True) 'name=Rajeev+Singh&phone=%2B919999999999&phone=%2B628888888888'

URL Decoding query strings or form parameters in Python (3+)
In Python 3+, You can URL decode any string using the unquote() function provided by urllib.parse package. The unquote() function uses UTF-8 encoding by default.
Let’s see an example -
>>> import urllib.parse >>> encodedStr = 'Hell%C3%B6%20W%C3%B6rld%40Python' >>> urllib.parse.unquote(encodedStr) 'Hellö Wörld@Python'

Decoding plus sign (+) to space character
The unquote() function does not decode plus sign (+) -
>>> urllib.parse.unquote('My+name+is+Rajeev') 'My+name+is+Rajeev'
But if you’re working with HTML forms then you’ll need to replace plus sign (+) with space character because HTML forms use application/x-www-form-urlencoded MIME type which encodes space character to plus sign (+) instead of %20.
For replacing plus sign with space, you can use the unquote_plus() function of urllib.parse package -
>>> import urllib.parse >>> encodedStr = 'My+name+is+Rajeev' >>> urllib.parse.unquote_plus(encodedStr) 'My name is Rajeev'

URL Decoding multiple query strings at once
If you want to decode or parse multiple query strings of type application/x-www-form-urlencoded (e.g 'name=Rajeev+Singh&phone=%2B919999999999'), then you can use parse_qs or parse_qsl functions provided by urllib.parse package.
The parse_qs function returns a dictionary of key-value pairs whereas the parse_qsl function returns a list of (key, value) tuples.
>>> import urllib.parse >>> queryStr = 'name=Rajeev+Singh&phone=%2B919999999999&phone=%2B628888888888' >>> urllib.parse.parse_qs(queryStr) {'name': ['Rajeev Singh'], 'phone': ['+919999999999', '+628888888888']}
>>> import urllib.parse >>> queryStr = 'name=Rajeev+Singh&phone=%2B919999999999&phone=%2B628888888888' >>> urllib.parse.parse_qsl(queryStr) [('name', 'Rajeev Singh'), ('phone', '+919999999999'), ('phone', '+628888888888')]

Sunday, February 16, 2020

Autohotkey for Google Translate

^!r::Reload ; Assign Alt-Ctr-R as a hotkey to restart the script.
#x:: ; Windows+X - Translate segment MemoQ, Across, Trados Studio with Google Translate
FileEncoding, utf-8
WinGetActiveTitle, Title
IfInString, Title, memoQ
Send ^+s
Sleep, 200
SendInput ^{F8}
Sleep, 300
SendInput ^a
Sleep, 300
SendInput ^c
Send ^c
Sleep, 300
Sleep, 200
IfInString, Title, Across
Send !{PgDn}
Sleep, 200
SendInput ^a
Sleep, 300
IfInString, Title, Trados Studio
Sleep, 300
Send ^{Ins}
Sleep, 200
SendInput ^a
Sleep, 300
SendInput ^c
Send ^c
Sleep, 300
Sleep, 300
Sleep, 300
searchtext := clipboard
;StringReplace, searchtext, searchtext, .%A_SPACE%, ._, All ;StringReplace, searchtext, searchtext, %A_SPACE%., _., All
;StringReplace, searchtext, searchtext, `;%A_SPACE%, `;_, All, ; `%5F - for underscore
;StringReplace, searchtext, searchtext, `.%A_SPACE%, `._, All ;Msgbox %searchtexturlencoded%
searchtexturlencoded := UriEncode(searchtext)
;searchtexturlencoded := URLEncoding(searchtext)
; StringReplace, searchtext, searchtext, %A_SPACE%&%A_SPACE%, `%26, All
; StringReplace, searchtext, searchtext, %A_SPACE%, +, All
Sleep, 300
RunWait, wget.exe -U "Mozilla/5.0 Chrome/62.0.3202.94" "" -O source.out.txt,, Hide
FileRead, targettext, source.out.txt ;Msgbox %targettext%
StringTrimLeft, targettext, targettext, 4
StringTrimRight, targettext, targettext, 73
quotes := ""","""
Loop, 4 ;MsgBox, Iteration number is %A_Index%.
addedvalue := (A_Index - 1)
textbreak = "`,null`,null`,%addedvalue%`]`,`[" ;MsgBox Textbreak %textbreak%
IfInString, targettext, %textbreak%
StringReplace, targettext, targettext, %textbreak%, ‡, All ;Msgbox targettext . %targettext%
occurences =
Loop, Parse, targettext, ‡
loopingtext = %A_LoopField% ;Msgbox Loopfield: %loopingtext%
StringLen, targetlength, loopingtext
StringGetPos, posghilimele, loopingtext, %quotes% ;MsgBox Poziţie glilimele %posghilimele% Msgbox Target length %targetlength%
StringLen, targetlength, loopingtext
StringTrimRight, occurence, loopingtext, (targetlength - posghilimele)
occurences .= occurence ;Msgbox occurence after add %occurences% ;occurences := occurences . occurence
StringReplace, occurences, occurences, ș, ş, All
StringReplace, occurences, occurences, Ș, Ş, All
StringReplace, occurences, occurences, ț, ţ, All
StringReplace, occurences, occurences, Ț, Ţ, All
StringReplace, occurences, occurences, %A_SPACE%._%A_SPACE%, .%A_SPACE%, All
StringReplace, occurences, occurences, `;%A_SPACE%_, `;%A_SPACE%, All
StringReplace, occurences, occurences, `;%A_SPACE%%A_SPACE%, `;%A_SPACE%, All
StringReplace, occurences, occurences, `._, `.%A_SPACE%, All
occurences := UnSlashUnicode(occurences)
Clipboard = %occurences% ;googleout := Clipboard
Send ^v
; IfInString, Title, memoQ {Send ^{Enter} ;Send ^+{Enter}Send !{Up}}

uriDecode(str) {
 If RegExMatch(str, "i)(?<=%)[\da-f]{1,2}", hex)
    StringReplace, str, str, `%%hex%, % Chr("0x" . hex), All
    Else Break

, str

UriEncode(Uri, RE="[0-9A-Za-z]"){
    While Code:=NumGet(Var,A_Index-1,"UChar")
    return, Res

UnSlashUnicode(s) ; unslash unicode sequences like \u0026
rx = \\u([0-9a-fA-F]{4})
pos = 0
pos := RegExMatch(s,rx,m,pos+1)
if (pos = 0)
StringReplace, s, s, %m%, % Chr("0x" . SubStr(m,3,4))
return, s

Wednesday, January 29, 2020

Excel formula to determine age from date of birth

Birth date Age
15.07.1996 24
07.06.1996 24
05.07.2002 18
04.12.2005 15
19.07.1992 28
23.11.1998 22
28.10.2000 20
02.10.2001 19
23.09.1996 24
09.05.2001 19
27.09.1997 23

Sometimes you might want to get the age of somebody, for instance, în order to determine whether they are minor or major (18 years old).
The German formula is: =(JAHR(JETZT())-JAHR(A2))

An English formula may be: ==INT(YEARFRAC(A2,TODAY()))
=DATEDIF(A1, TODAY(), "y")
or with months and days
=DATEDIF(A1,TODAY(),"Y") & " Years, " & DATEDIF(A1,TODAY(),"YM") & " Months, " & DATEDIF(A1,TODAY(),"MD") & " Days"

You may use conditional formatting (bedingte Formatierung) to highlight figures under 18.