Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-25-2019, 08:01 AM   #76
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Protopia View Post
I have Office 2013 installed - and it fails because it looks in C:\Program Files (x86)\Microsoft Office\Office12\ rather than Office15 where it is actually located.

I wouldn't imagine it is too difficult for this plugin to try to locate the WordConv.exe executable rather than assuming where it is located.

Office also comes in 64-bit versions, and some users might install it somewhere else - so perhaps the plugin needs first to use the registry to find the Office installation location and then to search through directories to find the executable.
Firstly, I agree with BR. Use DOCX as the input format instead of DOC. The results will probably be better.

But, you can configure the location of the wordconv.exe. Go into the preferences, "Input options" and select "DOC Input". I don't think finding it automatically is worth the effort.
davidfor is offline   Reply With Quote
Old 06-28-2019, 04:47 AM   #77
Protopia
Junior Member
Protopia began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2016
Device: Kindle Paperwhite 2015
@BetterRed - already did that for the 5 DOC files I had. But I added the comment so that someone could fix it if anyone was interested in putting in the effort.
Protopia is offline   Reply With Quote
Advert
Old 03-08-2025, 04:04 AM   #78
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
Dead plugin, but there's a better alternative with the LibreOffice converter that features 1:1 conversion from doc to odt (can convert from anything that it can read to anything that it can write, probably with a better quality than Python's internal conversion options).

Tested with the following batch on Windows. I don't know Python, but is there an easy option to adjust/fork the current "Microsoft Doc Input Plugin" to use LibreOffice in the background?

Code:
@echo off
REM search for documents in the "docs" folder where this batch is located
for /R docs %%f IN (*.doc) do if "%%~xf"==".doc" (
REM specific output directory
"C:\Program Files\LibreOffice\program\soffice" --convert-to odt --outdir "docs" "%%f"
REM LibreOffice --convert-to documentation
REM https://help.libreoffice.org/latest/...rtfilters.html
)
In Python probably sth. like this:
Code:
import subprocess # Import subprocess module
import os # We will use the exists() function from this module to know if the file was created.
def convert_doc_to_odt(file_path, output_dir):
    subprocess.run(
        f'/opt/libreoffice7.3/program/soffice \
        --headless \
        --convert-to odt \
        --outdir {output_dir} {file_path}', shell=True)
    
    pdf_file_path = f'{output_dir}{file_path.rsplit("/", 1)[1].split(".")[0]}.odt'
    
    if os.path.exists(pdf_file_path):
        return pdf_file_path
    else:
        return None
    
file_path = '/home/tarik/docs/file.docx'
output_dir = '/tmp/'
file = convert_doc_to_odt(file_path, output_dir)
if file:
    print(f'File converted to {file}.')
else:
    print('Unable to convert the file.')
sac is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Input Plugin] DOCX Input SauliusP. Plugins 42 06-05-2013 04:01 AM
Understanding html input plugin nimblebooks Conversion 3 02-26-2012 01:06 AM
telling the input plugin to allow a rel=nofollow nimblebooks Conversion 0 02-22-2012 05:01 PM
Plugin which uses net as input and output medve Development 0 12-04-2011 03:20 PM
Looking For MHT Input Conversion Plugin FlooseMan Dave Plugins 4 03-30-2010 05:52 PM


All times are GMT -4. The time now is 05:41 PM.


MobileRead.com is a privately owned, operated and funded community.