View Single Post
Old 11-28-2018, 02:57 PM   #992
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,619
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
I mainly hoped to motivate others to improve upon it. I'm afraid I haven't really had much time to look at it. That was one year ago already? Wow.

As an aside, while really stupid in principle, reflow actually works tremendously well on a MuPDF-rendered EPUBs.

I do apologize for not at least giving you the following information more explicitly, although at the time I hadn't actually tried it like I did now. As a basic workaround you could mod the PdfDocument file yourself like this:
Code:
diff --git a/frontend/document/pdfdocument.lua b/frontend/document/pdfdocument.lua
index 34f072e9..14ae115d 100644
--- a/frontend/document/pdfdocument.lua
+++ b/frontend/document/pdfdocument.lua
@@ -42,6 +42,8 @@ function PdfDocument:init()
     if not ok then
         error(self._document)  -- will contain error message
     end
+    local Screen = Device.screen
+    self._document:layoutDocument(Screen:getWidth(), Screen:getHeight(), 50)
     self.is_open = true
     self.info.has_pages = true
     self.info.configurable = true
In a diff file, + means added lines and - means removed lines.

So basically just add those two lines in that location:
Code:
    local Screen = Device.screen
    self._document:layoutDocument(Screen:getWidth(), Screen:getHeight(), 50)
The "50" here is a font size value that you can play around with.

The problem is integrating it properly into the UI, and even purely code-wise that's a just quick hack instead of proper code that can actually go into the program.

But of course perfection is the enemy of progress. Proper code + configuration first, UI later. I can't promise anything though; my spare time may be limited.
Frenzie is offline   Reply With Quote