Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2025, 04:23 PM   #1
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
[Conversion Input] Doc Input Libreoffice Plugin

Calibre plugin that makes docs searchable via Calibre full text search.

Description

The plugin enables Calibre internally to read and process doc files. The original doc in the user library remains unchanged. This is a fork of igieon/calibre-doc-input Thread.

Usage

If you're soffice.exe is not located in "C:\Program Files\LibreOffice\program\soffice.exe", you can edit it in HERE, then download the src folder, zip it (files at top level) & add it to Calibre.

IMPORTANT

Path to LibreOffice should be usually changed via Calibre Settings > Input Options > Doc Input > click on the location search button. This throws the following error:

Quote:
File "calibre_plugins.doc_input.doc_input_ui", line 70, in fileSearch
TypeError: EnumType.__call__() missing 1 required positional argument: 'value'
If anyone has an idea what this is about, please let me know (here / fork / PR / etc.). I'm not really into python and just hacked this adjustment together in vscode based on igieon's great base.
Attached Files
File Type: zip calibre-doc-input-libreoffice.zip (4.0 KB, 90 views)
sac is offline   Reply With Quote
Old 03-08-2025, 04:44 PM   #2
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
Github repository: calibre-doc-input-libreoffice
sac is offline   Reply With Quote
Advert
Old 03-09-2025, 07:30 AM   #3
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
Error seems fixed. Don't know how to edit the first post. Update is here.
Attached Files
File Type: zip calibre-doc-input-libreoffice.zip (4.0 KB, 68 views)
sac is offline   Reply With Quote
Old 03-09-2025, 08:13 AM   #4
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,968
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Better to simply open a .doc in LO Writer (save & edit as odt) or MS Word 2007 or later (save & edit in .docx) and fix page styles, paragraph styles, character styles, graphics, headers and links / anchors. Then a final extra save in docx for Calibre.
Quoth is offline   Reply With Quote
Old 03-09-2025, 02:20 PM   #5
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
Quote:
Originally Posted by Quoth View Post
Better to simply open a .doc in LO Writer (save & edit as odt) or MS Word 2007 or later (save & edit in .docx) and fix page styles, paragraph styles, character styles, graphics, headers and links / anchors. Then a final extra save in docx for Calibre.
Not an option for 200.000 docs. Also every conversion decreases quality. Example the attached original doc. LO can create a perfect 1:1 copy to ODT, but by converting to DOCX the headline is not intended and a wrong "headline (user)" instead of "headline" is used. Calibre itself is afterwards "removing" the first image of the docx if imported.

BTW: error is fixed, filedialog is showing, but 'wordconv_exe_path' is somehow still not used. It's always using the recommended value Probably because UI form is used instead of Widget?
Attached Files
File Type: zip docs.zip (241.4 KB, 71 views)
sac is offline   Reply With Quote
Advert
Old 03-09-2025, 03:31 PM   #6
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,968
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
I've never seen a "doc" for windows file since 1993 that didn't need fixing, and now especially to make into an epub.

A perfect 1:1 is useless if the doc isn't styled, Headers and links/anchors properly done. Besides it doesn't do perfect conversions. It's not possible, MS Word 2007 and later don't either.

Same applies to most docx I'm given. People that don't know how to use Word.

Last edited by Quoth; 03-09-2025 at 03:33 PM.
Quoth is offline   Reply With Quote
Old 03-09-2025, 05:22 PM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,712
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Assuming you have Word 2007 or later you can bulk convert .doc files to .docx with a 22 line VBA macro ==>>> How to batch convert .doc files to .docx format in Word?

BR
BetterRed is offline   Reply With Quote
Old 03-09-2025, 05:40 PM   #8
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
Quote:
Originally Posted by BetterRed View Post
Assuming you have Word 2007 or later you can bulk convert .doc files to .docx with a 22 line VBA macro ==>>> How to batch convert .doc files to .docx format in Word?

BR
That looks awesome, good to know

However, I have some archives with docs that I want to keep in their original form. Just need full-text search & administration in Calibre (and possibility to convert some in Calibre if required).

I rewrote the plugin as "class PluginWidget(Widget)" similar to KFX Input (that uses the same OptionRecommendation). However, issue remains that QT is not synching "options.wordconv_exe_path". Noone who has an idea what's causing this?
sac is offline   Reply With Quote
Old 03-09-2025, 06:27 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,712
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I do recall that the location of wordconv.exe was the bane of the DOC conversion input plugin.

The macro in the link I gave you creates a new .docx alongside the .doc. I used a similar macro (it had the folder path hard coded) to convert several thousand .doc files to .docx back in 2009. I deleted the .doc files soon after moving the .docx files into a calibre library a couple of years later.

BR
BetterRed is offline   Reply With Quote
Old 03-09-2025, 06:43 PM   #10
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
That's why this plugin is using LibreOffice. Attached the Widget version, GUI shows now also on a fresh Calibre Portable in Settings > Input Options, but still:

issue remains that QT is not synching "options.wordconv_exe_path". Noone who has an idea what's causing this?
Attached Files
File Type: zip calibre-doc-input-libreoffice.zip (3.4 KB, 73 views)
sac is offline   Reply With Quote
Old 03-12-2025, 05:38 PM   #11
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
In general it seems that the missing options argument in file dialogs was a bug in PyQt6, fixed in QtPy 2.4.0 https://github.com/spyder-ide/qtpy/releases/tag/v2.4.0 in 2023

I wonder what version Calibre uses.
sac is offline   Reply With Quote
Old 03-15-2025, 07:08 AM   #12
sac
Junior Member
sac began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2025
Device: Computer
Calibre is not using QtPy.

Guess the error is somewhere in

__init__.py Imports or config
Code:
    def gui_configuration_widget(self, parent, get_option_by_name, get_option_help, db, book_id=None):
        from calibre_plugins.doc_input.doc_input import PluginWidget
        return PluginWidget(parent, get_option_by_name, get_option_help, db, book_id)
doc_input.py Imports or config
Code:
    def __init__(self, parent, get_option, get_help, db=None, book_id=None):
        self.db = db                # db is set for conversion, but not default preferences
        self.book_id = book_id      # book_id is set for individual conversion, but not bulk

        Widget.__init__(self, parent, ['docx_no_cover', 'wordconv_exe_path'])
        self.initialize_options(get_option, get_help, db, book_id)
Would be awesome if someone can confirm if this is correct.

Last edited by sac; 03-15-2025 at 07:12 AM.
sac is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Conversion Plugin] KFX Input jhowell Plugins 1022 06-26-2025 04:13 PM
[Conversion Input] Microsoft Doc Input Plugin igi Plugins 77 03-08-2025 04:04 AM
Conversion plugins without input plugin geek1011 Development 5 04-02-2018 05:14 PM
[Conversion Input] LaTeX Formulas Input Conversion Plugin sevyls Plugins 0 03-23-2015 05:52 AM
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 11:26 PM.


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