brikell69 / nookdevs

Automatically exported from code.google.com/p/nookdevs
0 stars 0 forks source link

[apdfview] defects rendering PDF files #103

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open a PDF file
2. All the fonts are rendered with system font (DroidSans?) regardless the 
embedded ttf fonts
3. Page size fails on several PDF files. Caused landscape files cropped even 
after rotation. (see attachment)
4. Page resizing dialog shifts into e-ink area
5. Glyphs missing on some PDF files (ex. "ff", "fi" becomes boxess)

What is the expected output? What do you see instead?
PDF rendered with embedded TTF fonts and auto-resize with white area crop

What version of the product are you using? On what operating system?
SoftRoot 2.4.1

Original issue reported on code.google.com by yuanc...@gmail.com on 31 Jul 2010 at 12:51

Attachments:

GoogleCodeExporter commented 9 years ago
I'm going to be working on fixing issues with this over the next few weeks.

Original comment by hari.swa...@gmail.com on 31 Jul 2010 at 1:17

GoogleCodeExporter commented 9 years ago

Original comment by hari.swa...@gmail.com on 31 Jul 2010 at 1:17

GoogleCodeExporter commented 9 years ago
It would be nice if someone could point me some direction on how to build from 
source. (on linux) I have some special needs and would like to see if I can 
contribute to this project.

Original comment by yuanc...@gmail.com on 31 Jul 2010 at 11:06

GoogleCodeExporter commented 9 years ago
I use Eclipse. 
You have to create NookDependency and nookCommon as java projects with android 
1.5 jar in the build path.

Others are created as Android projects. You should be able to import them.
In Java build path settings in Eclipse, make sure in Project tab, nookCommon 
and nookDependency are selected.
Under Order & exports tab, nookDependency should be the first one and 
unchecked. 
Others can be in any order and checked.

Original comment by hari.swa...@gmail.com on 1 Aug 2010 at 12:13

GoogleCodeExporter commented 9 years ago
Hi Hari, it would be great if you can add the default options like bookmarks, 
goto, and also it would be great if you can change the code to check the last 
read position from the normal pdf reader and use it to load the page. The zoom 
feature and landscape mode is very nice. Also, toggling from landscape to 
portrait mode messes up the rendering, esp when the pdf has complex images.

Original comment by paddy.iy...@gmail.com on 1 Aug 2010 at 2:56

GoogleCodeExporter commented 9 years ago
Thanks a lot, Hari. Guess I need to do some homework here. (haven't touched 
java for long and never used Eclipse) It looks like to me that some of the 
issues need to be fixed from the native part. Is there any thing need to be 
noticed?

Original comment by yuanc...@gmail.com on 2 Aug 2010 at 3:40

GoogleCodeExporter commented 9 years ago
ok. I found out the reason. It's only working with fonts that are embedded 
fully and not as subsets. I'll have to figure out how to fix that.

For page size issue, I have no idea why this file is behaving like this. I 
tested with few other pdfs with same size and they all display ok. 

Original comment by hari.swa...@gmail.com on 2 Aug 2010 at 9:06

GoogleCodeExporter commented 9 years ago
native code is also specific to android & requires development using android 
NDK. NDK installation & sample docs will be a good place to start.

Original comment by hari.swa...@gmail.com on 2 Aug 2010 at 9:09

GoogleCodeExporter commented 9 years ago
Hari, I installed the latest apdf app and it messed up the rendering of pdf 
file. I tried Spring framework reference manual. The pervious version displays 
the text properly but the latest version is not displaying it properly and it 
became cryptic.

Original comment by paddy.iy...@gmail.com on 11 Aug 2010 at 1:08

GoogleCodeExporter commented 9 years ago
something must have gone wrong in the build. I'll check it out tomorrow & 
update the apk. Thanks for letting me know.

Original comment by hari.swa...@gmail.com on 11 Aug 2010 at 1:23

GoogleCodeExporter commented 9 years ago
corrected the apk. should be better now.

Original comment by hari.swa...@gmail.com on 11 Aug 2010 at 1:27

GoogleCodeExporter commented 9 years ago
Hi Hari, now the font looks good. but looks like swiping the ribbon does not 
work. i have to press previous and next button instead to see the text that 
crossed the display area. not sure if it is a bug or a new enhancement feature 
to make things easy :-)
Also, it would be great if we have another set of options that work simiar to 
the default reader. That mode, instead of having zoom option can reflow the 
text and also let us increase the font size. zoom mode is a bit difficult to 
read the docs as we have to constantly press forward and back. 
Also would appreciate if you can introduce other features like extended goto 
similar to the default reader, bookmarks (optional)

Original comment by paddy.iy...@gmail.com on 12 Aug 2010 at 1:20

GoogleCodeExporter commented 9 years ago
I removed the swipe logic because it requires additional resources to have full 
image in memory instead of just what is visible. It was causing frequent JVM 
crashes.

I'm planning to add reflow option soon. But It's not possible to combine zoom & 
reflow. I'll add an option to select the mode. 
zoom mode is mainly useful for reading comics and other pdfs with many images.
If the zoom is set to Auto, it resizes the page to fit the screen. That would 
be the best size possible without reflowing. 
Since the B&N reader does reflow well, I didn't feel like that's something we 
need right away. 

I want to wrap up the pdf display part before adding other features like 
chapters, password protected files, go to furthest read point, find text etc. 
It might be a couple of months before the final product.
Source code is available here. If anyone is interested, feel free to modify the 
code and add features.
Thanks for the feedbacks. 

Original comment by hari.swa...@gmail.com on 12 Aug 2010 at 2:18

GoogleCodeExporter commented 9 years ago
hari, please consider adding higher zoom levels and other features that will 
make it easier to read scanned PDF files.  Those cannot be reflowed since they 
are just made from scanned images (unlike PDF files generated from the native 
text using Word + Acrobat Pro etc.).  Thanks.

Original comment by jmc...@gmail.com on 12 Aug 2010 at 2:34

GoogleCodeExporter commented 9 years ago
Dear Hari, I can confirm that the new build does very well on the font 
rendering. It's great! Just that I'm having the same problem as jmcode that 
fine tuning with swiping is needed due to some PDF files with large margins or 
some wrong settings. (please refer to my attachment) Another thought is to have 
auto margin detect or just have up to say 120% buffer for position fine-tuning. 
Also for scanned images, is it possible to have some preset zoom levels with 
proper viewing orders.It would be nice to re-map the 4-buttons to 4-directions. 
Honestly speaking, the nook build-in viewer does very well on re-flow, there's 
no much reason for me to use other viewer except for landscape view.

Original comment by yuanc...@gmail.com on 12 Aug 2010 at 6:11

Attachments:

GoogleCodeExporter commented 9 years ago
Hari, after the latest build, your PDF viewer renders the pdf (converted from 
msword) far far better than the nook reader. it keeps the tables as is and i am 
now able to clearly view the big and complex architectural diagrams. While 
going through such complex docs, i found one discomfort of not having the 
swipe. if a word or image crosses the display border, it becomes very tough to 
read as we can see only one part of that image or word at a time. if we can 
have the swipe feature, we can slightly reposition the doc to get a full view 
of that block :) or how about instead of just displaying the rest of the page, 
you can display the last 10% to 20% from the previous screen and followed by 
the next screen. it is easy to say than implement :-) also this means while 
formatting the pdf, you would have to do that to the entire doc to have a 
consistent display. 

Original comment by paddy.iy...@gmail.com on 12 Aug 2010 at 1:06

GoogleCodeExporter commented 9 years ago
and regarding "Since the B&N reader does reflow well, I didn't feel like that's 
something we need right away. ", it is true, but b&n reader doesnot render in 
landscape mode :-) it would be a big plus to combine landscape mode with reflow

Original comment by paddy.iy...@gmail.com on 12 Aug 2010 at 1:08

GoogleCodeExporter commented 9 years ago
Take a look at the attached apk & let me know your comments.
I added the swipe logic back with 20% extra buffer & also added 2 extra buttons 
to move up/down or sideways. also mapped left side nook buttons to the up/down 
buttons.
I already increased the zoom level to 300% in the last apk. Is there anything 
else we need related to zoom & landscape mode? 
I'm going to start working on the reflow stuff next. 

Thanks.

Original comment by hari.swa...@gmail.com on 15 Aug 2010 at 11:43

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Hari, I tried the attached apk. This tried at 200% zoom. actually it is not 
using the entire screen space properly. PFA the screenshots for the same. i 
tried swipe and it is not displaying the last few letters in each row.

Original comment by paddy.iy...@gmail.com on 16 Aug 2010 at 2:08

Attachments:

GoogleCodeExporter commented 9 years ago
I think Paddy went into the same problem risen previously: some PDF files 
doesn't have proper page size declared and/or very larger margin. This would 
need a smart margin removal which is not trivial to implement. Sorry I haven't 
check the latest build. Just that I'd like to request a finer zoom steps using 
a slider or spin-box instead of menu items. (easy to make mistakes) Thanks a 
lot for the great efforts Hari!

Original comment by yuanc...@gmail.com on 16 Aug 2010 at 9:07

GoogleCodeExporter commented 9 years ago
ok. I'll take a look. Thanks

Original comment by hari.swa...@gmail.com on 16 Aug 2010 at 11:42

GoogleCodeExporter commented 9 years ago
Dear Hari, please take my previous attachment (17.pdf) as an example. It's a 
two column article, like most journal paper, and a very large margin. Somehow 
20% is slightly not enough for panning when zoom to ~200%. This could be solved 
by adding to 25% or having more overlapping area. I guess this is the same as 
Paddy's issue. It would be better that Paddy can provide his PDF file.

One most bothering stuff is when viewing the 2nd column (either portrait or 
landscape), "down" button always goes to the very left. I need to click on more 
"right" button to continue my reading. If this "carriage return" is on some 
purpose, maybe it's better to have it as a separated button?

BTW, now I have two PDF files crash on loading but works previously. I attach 
one of them here. It seems due to NO embedded font. (acroread will complain 
about missing font, but poppler based reader work fine on my desktop)

Original comment by yuanc...@gmail.com on 17 Aug 2010 at 4:05

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry I forgot to include the logcat. Now in attachment.

BTW, a default white activity view background would reduce one flicker for the 
first time loading?

Original comment by yuanc...@gmail.com on 17 Aug 2010 at 4:14

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry for keeping bothering. Please turn on Byte-code-interpreter (BCI) support 
for FreeType/Poppler. The corresponding patent is expired and some Chinese 
fonts (widely embedded in PDF) breaks (literally) w/o it. I forgot about this 
as the font was replaced with Droid sans fallback in the very old version. 
Small-size fonts will render prettier with BCI too.

http://www.freetype.org/patents.html

Original comment by yuanc...@gmail.com on 17 Aug 2010 at 4:36

GoogleCodeExporter commented 9 years ago
Thanks for the details. I'll start looking into these later this week. I think 
the crashes are due to memory issues. 

Original comment by hari.swa...@gmail.com on 17 Aug 2010 at 11:54

GoogleCodeExporter commented 9 years ago
Hi, I would like to see zoom levels of 175% and 225% if possible, thanks in 
advance.

Original comment by Attah...@gmail.com on 17 Aug 2010 at 4:48

GoogleCodeExporter commented 9 years ago
Hari, could you please reverse swipe directions in landscape mode?
Thank you in advance!

Original comment by gor...@gmail.com on 14 Sep 2010 at 11:43