Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-09-2020, 04:47 PM   #31
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
Quote:
Originally Posted by roger64 View Post
Hi

As a -nearly - daily user of both writer2xhtml.oxt on LO 6.4.5.2. and of writer2latex.jar with Sigil 1.3. and odtImport plugin 0.3.1. (both of them use in fact writer2xhtml 1.6.1.), I just can say that they both work nicely today. I'll try it asap with LO 7.
I'm interested that you get writer2xhtml to run well with LO 6.4.5.2. I'm using 6.3.5.2 and I couldn't get any of the writer2xhtml options to run to completion when launched from the File > Export menu. Every time the export failed with some sort of general import/export error.

This was disappointing because I rather liked the gui interface with all the options that writer2xhtml presented.

The one case which did work ok was from the Publish button on writer2xhtml's small toolbar. Because it didn't allow me to select a file name, care was needed to avoid overwriting a previous version.

Quote:
- Images in the odt file (including cover) are processed without problem.
In the case I tried, I didn't have a cover image in the odt file because I normally use Sigil to add it to the epub file. So I was somewhat surprised to see that the ODTimport plugin hijacked my first image to build a cover page - especially since it didn't reuse the image in its proper place.

Over the weekend, I loaded an odt file into Calibre and then converted it to epub. The result wasn't too bad but the epub did need some cleaning up.

Perhaps the worst was Calibre's production of unwanted and useless <span>'s. One short paragraph was more than doubled in size by what seemed to me to be useless <span>'s calling up CSS "classes" to apply to a single letter. The original odt paragraph was a two liner in Text Body style with no manual formatting applied.

Calibre did not hijack any image to produce a cover page but instead created the page with a text based svg image.

At present, I'm unable to decide which workflow is going to require the least cleaning up.
philja is offline   Reply With Quote
Old 08-09-2020, 09:21 PM   #32
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by philja View Post
In the case I tried, I didn't have a cover image in the odt file because I normally use Sigil to add it to the epub file. So I was somewhat surprised to see that the ODTimport plugin hijacked my first image to build a cover page - especially since it didn't reuse the image in its proper place.
.
Hi.

There is no "hijacking" in writer2xhtml but only user selected options.
1. - for the writer2xhtml GUI (for LO) you have to check or uncheck this one
Quote:
"Use first image as cover image".
2. - for odtImport, you must look at your config.xml file, and check the value of
Quote:
<option name="cover_image" value="true" />
and set it according to your need.

As you can see, the wording of the config.xml options can be slightly different from the one of the GUI, but if you go carefully and slowly through all the options of the config.xml , you'll find similar ones to the GUI.

The purpose of each option is given in the writer2xhtml documentation online.

Last edited by roger64; 08-09-2020 at 09:50 PM. Reason: similar
roger64 is offline   Reply With Quote
Advert
Old 08-10-2020, 12:37 PM   #33
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
Quote:
Originally Posted by roger64 View Post
Hi.

2. - for odtImport, you must look at your config.xml file, and check the value of

and set it according to your need.

As you can see, the wording of the config.xml options can be slightly different from the one of the GUI, but if you go carefully and slowly through all the options of the config.xml , you'll find similar ones to the GUI.

The purpose of each option is given in the writer2xhtml documentation online.
Thanks for that, Roger. Complete ignorance on my part. I had not even investigated under the hood on the ODTimport plugin.

I see I've got some reading up to do to optimise my settings for the plugin. And I should think that once I've taken that step, it will probably be as easy as the LO Writer Extension.
philja is offline   Reply With Quote
Old 08-11-2020, 01:09 AM   #34
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by philja View Post

I see I've got some reading up to do to optimise my settings for the plugin. And I should think that once I've taken that step, it will probably be as easy as the LO Writer Extension.
You're welcome.

Yes, it's worth it if you plan to use odtImport regularly. You need to do it only once.
The same goes for the epub.css file (if you wish to append one).
roger64 is offline   Reply With Quote
Old 01-23-2021, 10:29 AM   #35
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Windows 10 32 bit, Sigil v. 1.4.3.
I used the plugin for the first time, but got the following error message:
Code:
Status: failed


This is Writer2xhtml, Version 1.4 (2014-02-16)

Starting conversion...
Reading style sheet C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\epub.css
Reading configuration file C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\config.xml
Converting C:\Users\Juerg\OneDrive\OCR\Johann K. Musus, Die Entfhrung\Johann K. Musus, Die Entfhrung.odt
Done!
I only can see that the original file location should be named: "Musäus", instead of "Musus". Could this be the reason for the failure?
Leonatus is offline   Reply With Quote
Advert
Old 01-23-2021, 11:19 AM   #36
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Leonatus View Post
Windows 10 32 bit, Sigil v. 1.4.3.
I used the plugin for the first time, but got the following error message:
[CODE]Status: failed
You most likely installed the wrong version of the plugin. Please check the plugin version in the Plugin Manager dialog box.

It should show ODTImport 0.3.2.

If it doesn't, please uninstall the current version and install ODTImport 0.3.2.
Doitsu is offline   Reply With Quote
Old 01-23-2021, 01:15 PM   #37
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
You are right, thank you! But now it's this message:
Code:
Status: failed

Python Version: 3.8.3 

writer2latex.jar command line:
java -jar C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\writer2latex.jar -epub -config=C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\config.xml -stylesheet=C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\epub.css E:/OCR/Johann Musus, Die Entfuhrung/Johann K. Musäus, Die Entführung.odt

writer2latex.jar messages:

This is Writer2xhtml, Version 1.6 (2018-03-06)

Starting conversion...
Reading style sheet C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\epub.css
Reading configuration file C:\Users\Juerg\AppData\Local\sigil-ebook\sigil\plugins\ODTImport\config.xml
Converting E:\OCR\Johann Musus, Die Entfuhrung\Johann K. Musus, Die Entfhrung.odt
Done!
Leonatus is offline   Reply With Quote
Old 01-23-2021, 02:33 PM   #38
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Leonatus View Post
You are right, thank you! But now it's this message:[CODE]Status: failed
Unfortunately, I can't reproduce this issue on my Windows 10 machine, even if I insert spaces and umlauts into the .odt file name.

If you've installed this plugin on an older Windows machine without Unicode support, try removing all umlauts and/or accented characters from the file name.

If that doesn't fix your problem, test the plugin with this test file, which converted fine on my Windows 10 machine.
Doitsu is offline   Reply With Quote
Old 01-24-2021, 07:27 AM   #39
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Renaming the file (and the directory, for safety reasons) and removing all Umlauts and periods did the trick!
The result looks really pretty.
Thank you!
Leonatus is offline   Reply With Quote
Old 04-09-2022, 01:18 PM   #40
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
I've just had a failure of ODTimport plugin in Sigil. Although my Sigil 1.1.0 is rather old, it's what comes with UbuntuStudio 20.04 LTS (which I'm hoping to update to 22.04 in a few weeks' time) and I had it working well in 2020 and 2021. I had a few problems which were resolved in this thread towards the end of 2020. I note that 0.3.2 is still the current version of the ODTimport plugin.

My last useful production using ODTimport with my setup was in the summer of 2021. Although I did run into a snag which my investigations showed to be a problem caused by my replacing png images with gifs in the odt file before converting to epub. When I returned to the original pngs, all was well. I'm afraid the notes I kept of that incident were rather sketchy.

Today my odt file has all png images so that wouldn't appear to be the problem. The error messages are:

writer2latex.jar messages:

This is Writer2xhtml, Version 1.6 (2018-03-06)

Starting conversion...
Reading style sheet /home/pnj/.local/share/sigil-ebook/sigil/plugins/ODTImport/epub.css
Reading configuration file /home/pnj/.local/share/sigil-ebook/sigil/plugins/ODTImport/config.xml
Converting /home/pnj/Documents/Cycle_des_quintes_Workbooks/Volume-1/e-book versions/CDQ-WkBk-V1a-eBkdev.odt
Writer2xhtml failed!

Java error messages:
Exception in thread "main" org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is made to reference a node in a context where it does not exist.
at java.xml/com.sun.org.apache.xerces.internal.dom.ParentNode. internalRemoveChild(ParentNode.java:500)
at java.xml/com.sun.org.apache.xerces.internal.dom.ParentNode. removeChild(ParentNode.java:480)
at writer2latex.xhtml.TextConverter.handleParagraph(T extConverter.java:604)
at writer2latex.xhtml.TextConverter.traverseBlockText (TextConverter.java:244)
at writer2latex.xhtml.TextConverter.traverseBlockText (TextConverter.java:181)
at writer2latex.xhtml.TextConverter.convertTextConten t(TextConverter.java:138)
at writer2latex.xhtml.Converter.convertInner(Converte r.java:296)
at writer2latex.base.ConverterBase.convert(ConverterB ase.java:128)
at writer2latex.base.ConverterBase.convert(ConverterB ase.java:103)
at writer2latex.epub.EPUBConverter.convert(EPUBConver ter.java:48)
at writer2latex.base.ConverterBase.convert(ConverterB ase.java:96)
at writer2latex.Application.doConversion(Application. java:279)
at writer2latex.Application.main(Application.java:93)

If I go back to the last odt file I converted to epub in Sigil/ODTimport last summer, I can import a copy and convert to epub ok so the tool combination is not broken. The problem would seem to be in my new Writer odt file.

Can anyone suggest what the problem could be and where to look for correcting it?
philja is offline   Reply With Quote
Old 04-09-2022, 02:02 PM   #41
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
I've just tested the plugin on my Arch Linux machine with the latest JRE, and it worked fine.

Since the plugin comes with Writer2LaTeX 1.6.0, maybe replacing writer2latex.jar with the Writer2LaTeX 1.6.1 .jar file might help.

You can check which version is installed by looking at the HTML source code of converted .odt files.
Spoiler:
Code:
<!-- This file was converted to xhtml by Writer2xhtml ver. 1.6.1. See http://writer2latex.sourceforge.net for more info. -->

If it doesn't say Writer2xhtml ver. 1.6.1., you're still using Writer2LaTeX 1.6.0.
(You can download Writer2LaTeX 1.6.1 from the author's website.)
Please note that the 1.9.x versions don't support .epub output and can't be used with this plugin.

If replacing Writer2LaTeX 1.6.0 with Writer2LaTeX 1.6.1 didn't help, you might have to upgrade/downgrade JRE/Java.
It also couldn't hurt to save your .odt file as a .docx file and then save it as an .odt file again.
Doitsu is offline   Reply With Quote
Old 04-09-2022, 06:36 PM   #42
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
Quote:
Originally Posted by Doitsu View Post
I've just tested the plugin on my Arch Linux machine with the latest JRE, and it worked fine.

Since the plugin comes with Writer2LaTeX 1.6.0, maybe replacing writer2latex.jar with the Writer2LaTeX 1.6.1 .jar file might help.

You can check which version is installed by looking at the HTML source code of converted .odt files.
Spoiler:
Code:
<!-- This file was converted to xhtml by Writer2xhtml ver. 1.6.1. See http://writer2latex.sourceforge.net for more info. -->

If it doesn't say Writer2xhtml ver. 1.6.1., you're still using Writer2LaTeX 1.6.0.
(You can download Writer2LaTeX 1.6.1 from the author's website.)
Please note that the 1.9.x versions don't support .epub output and can't be used with this plugin.

If replacing Writer2LaTeX 1.6.0 with Writer2LaTeX 1.6.1 didn't help, you might have to upgrade/downgrade JRE/Java.
It also couldn't hurt to save your .odt file as a .docx file and then save it as an .odt file again.
Thanks for the prompt reply. First, because I suspected my odt file rather than the tools, I tried your suggestion of saving to docx and then back to odt but that didn't bring happiness. So I went for the other checks.

I did have the older Writer2Latex 1.6.0 so I fetched 1.6.1 and swapped out the writer2latex.jar file in the ODTimport plugin. That appears to have fixed the problem and Sigil has now converted my odt file to epub.

Just remains now to tune up the epub a bit to correspond with my own style.css file.

Thanks for the help.
philja is offline   Reply With Quote
Old 04-11-2022, 07:06 AM   #43
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
ODTimport config file

I spent some time editing the config.xml in ODTimport after reading the writer2latex user manual. I managed to get most things working the way I wanted especially getting my LO Writer styles mapped. I found that Writer's Text Body style mapped to a bog-standard <p> no matter what I called my corresponding css style. I suppose there is an understandable logic to that so I found a workaround.

I did not have any success with mapping my list styles but I can live with correcting those in the epub file with Sigil after conversion.

Where I absolutely failed was in getting my personal StyleSheet.css file recognised and imported. I tried all the variations I could think of when editing the config line:

<option name="custom_stylesheet" value=" " />

but never hit the sweet spot so the resulting epub had my style names correctly shown in all the xhtml files but the styles were not implemented because I had failed to get my stylesheet linked in.

My workaround was to place a copy of my stylesheet in the ODTimport plugin directory and rename it to epub.css. That worked.

Could someone please explain the correct formula for getting an external stylesheet linked in automatically during the conversion?
philja is offline   Reply With Quote
Old 04-11-2022, 12:33 PM   #44
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by philja View Post
I spent some time editing the config.xml in ODTimport after reading the writer2latex user manual.My workaround was to place a copy of my stylesheet in the ODTimport plugin directory and rename it to epub.css. That worked.
That's is not a workaround--it's the way the plugin is supposed to be used.
(To keep the plugin code simple, the plugin will look for an epub.css file in the plugin folder.)
Doitsu is offline   Reply With Quote
Old 04-11-2022, 02:32 PM   #45
philja
Groupie
philja began at the beginning.
 
Posts: 177
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
Quote:
Originally Posted by Doitsu View Post
That's is not a workaround--it's the way the plugin is supposed to be used.
(To keep the plugin code simple, the plugin will look for an epub.css file in the plugin folder.)
Well, thanks. I got there then although I made it a bit more difficult for myself by relying too much on the writer2latex user manual.
philja is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 495 10-19-2024 07:06 AM
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 27 01-16-2023 02:25 AM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 03:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 01:11 PM


All times are GMT -4. The time now is 03:11 AM.


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