Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word document page display #5771

Closed
SilverGreen93 opened this issue Jan 15, 2020 · 5 comments
Closed

Word document page display #5771

SilverGreen93 opened this issue Jan 15, 2020 · 5 comments

Comments

@SilverGreen93
Copy link
Contributor

  • KOReader version: 2019.12
  • Device: Kobo Forma

Issue

It seems that Koreader cannot display Word documents (docx) in page view. In fact I cannot find any view mode settings for this type of document. It treats it like a Rich text format document.

Is there any plan to add support for page or other display modes?

@poire-z
Copy link
Contributor

poire-z commented Jan 15, 2020

DocX support comes from upstream, details and links to their work in koreader/crengine#314. You can ask there if your have more questions or need some info (or want to hack it and extend it :).
(I personally understand not much of that code, and I'm not much interested in digging in it.)

If by "page view" you mean having Word headers and footers, you're right, there's no support for that. Just as there's no support for that in any other document type (epub, html, rtf). Dunno if it supports that for .doc (not .docx), but I guess it doesn't.
But you can view each of these format, including DocX, in the page/continuous mode of KOReader - and in page mode, it adds its own footer.

Dunno what you mean about "other display modes", if it's the Page|Web|... views we have in MS Word, may be that's "user agent" stuff - and KOReader has its own set of modes, page|continuous, just that, I don't think we need more :)
As for docX support, it just convert a DocX to a HTML DOM tree, the same way it's done for an EPUB, and crengine displays them the same once that is done.

@SilverGreen93
Copy link
Contributor Author

"Page mode" I was reffering to view the page as displayed in Word on PC, to keep existing formating and page breaks. Koreaders splits the pages where it seems fit, ignoring the pagination from the document. As a side effect, images are misplaced.

@poire-z
Copy link
Contributor

poire-z commented Jan 15, 2020

OK. I can confirm the DocX code does not manage (yet) any length/margin/padding/color/fontsize - and its styling support is limited to bold/italic/underline/strike, and tables/lists/images. I don't think I've seen any page break stuff. So, yes, many stuff missing, and it's mostly a subset making it similar to rich text.
Which is already nice, enough for me to read docs from work :)
But looking at the code, the DocX format is really a beast of its own, not much related to HTML. So, one would have to investigate the format to add the missing code.

@SilverGreen93
Copy link
Contributor Author

Yeah, I see that a lot of work may be required and maybe it doesn't bring much value to invest time in.

@Frenzie
Copy link
Member

Frenzie commented Feb 2, 2020

The most accurate way to view a Word document is to print it as PDF. You might also be able to generate a fairly decent EPUB directly from Word or with something like LibreOffice Writer or calibre as an in-between. The ability to open Word documents directly probably shouldn't be regarded as anything more than a convenience so you can read them easily.

I'll close this now because there isn't really anything that we can realistically do (unless someone's really motivated). :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants