Skip to content

Commit 3b56514

Browse files
committed
Merge branch 'release/alpha/master'
2 parents 76fea17 + 84a5db9 commit 3b56514

File tree

91 files changed

+5534
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5534
-413
lines changed

CMakeLists.txt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
2+
project(kpdfsync LANGUAGES NONE)
3+
4+
find_package(Java 1.8 REQUIRED)
5+
include(cmake/GetVersion.cmake)
6+
include(cmake/AddResource.cmake)
7+
include(cmake/JavaCmake.cmake)
8+
9+
set(KPDFSYNC_BIN_DIR ${CMAKE_BINARY_DIR}/bin)
10+
set(KPDFSYNC_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib)
11+
set(KPDFSYNC_DOCS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs)
12+
set(KPDFSYNC_RELEASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
13+
set(KPDFSYNC_PACK_DIR ${KPDFSYNC_RELEASE_DIR}/current)
14+
set(KPDFSYNC_RELEASE_RESOURCE_DIR ${KPDFSYNC_RELEASE_DIR}/resource)
15+
16+
set(KPDFSYNC_JDK_VER_TARGET 8)
17+
set(KPDFSYNC_VER 0.0.0 CACHE STRING "Application version.")
18+
set(KPDFSYNC_TAG <undef> CACHE STRING "Application version tag.")
19+
20+
# Used by cmake/JavaCmake.cmake
21+
set(CMAKE_JAVA_COMPILE_FLAGS -target ${KPDFSYNC_JDK_VER_TARGET}
22+
-source ${KPDFSYNC_JDK_VER_TARGET})
23+
set(JAVA_CLASS_DIR ${CMAKE_BINARY_DIR}/class)
24+
25+
set (KPDFSYNC_PACK_DIR_FILES
26+
${KPDFSYNC_RELEASE_RESOURCE_DIR}/kpdfsync.bat
27+
${KPDFSYNC_RELEASE_RESOURCE_DIR}/kpdfsync
28+
${KPDFSYNC_DOCS_DIR}/QuickReference.pdf
29+
${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
30+
${CMAKE_CURRENT_SOURCE_DIR}/README.md
31+
)
32+
33+
add_custom_command(
34+
OUTPUT
35+
${KPDFSYNC_BIN_DIR}/tools
36+
${KPDFSYNC_BIN_DIR}/pdfclown.jar
37+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${KPDFSYNC_RELEASE_RESOURCE_DIR}/tools
38+
${KPDFSYNC_BIN_DIR}/tools
39+
COMMAND ${CMAKE_COMMAND} -E copy ${KPDFSYNC_LIBS_DIR}/pdfclown.jar ${KPDFSYNC_BIN_DIR}
40+
)
41+
42+
add_custom_target(build-all ALL)
43+
44+
add_custom_target(mv-deps
45+
DEPENDS ${KPDFSYNC_BIN_DIR}/tools
46+
${KPDFSYNC_BIN_DIR}/pdfclown.jar)
47+
48+
add_custom_target(run
49+
COMMAND ${CMAKE_COMMAND} -E env java -jar coderarjob.kpdfsync.jar
50+
WORKING_DIRECTORY ${KPDFSYNC_BIN_DIR}
51+
)
52+
53+
add_custom_target(pack
54+
COMMAND ${CMAKE_COMMAND} -E remove_directory ${KPDFSYNC_PACK_DIR}
55+
COMMAND ${CMAKE_COMMAND} -E make_directory ${KPDFSYNC_PACK_DIR}
56+
COMMAND ${CMAKE_COMMAND} -E copy ${KPDFSYNC_PACK_DIR_FILES} ${KPDFSYNC_PACK_DIR}
57+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${KPDFSYNC_BIN_DIR} ${KPDFSYNC_PACK_DIR}/bin
58+
COMMAND ${CMAKE_COMMAND} -E echo "Package created in directory: ${KPDFSYNC_PACK_DIR}"
59+
)
60+
61+
add_dependencies (pack mv-deps build-all)
62+
add_dependencies(build-all coderarjob.ajl coderarjob.kpdfsync.lib coderarjob.kpdfsync)
63+
add_dependencies(run build-all mv-deps)
64+
65+
add_subdirectory(src/coderarjob/ajl)
66+
add_subdirectory(src/coderarjob/kpdfsync/lib)
67+
add_subdirectory(src/coderarjob/kpdfsync/poc)

README.md

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,62 @@ Here is the rough roadmap of the development.
4646

4747
----
4848

49+
- [X] Bug Fixes: Some minor fixes in UI
50+
- [X] Feature: Added new parser for reading older Kindle Clippings format.
51+
- [X] UI change to select different parsers.
52+
- [ ] **Alpha Release 4**
53+
54+
----
55+
4956
- [ ] Fine tune the rough edges in the supporting library.
5057
- [ ] Memory/Resource optimization.
5158
- [ ] Finalizing and optimizing the Graphical User Interface.
5259
- [ ] **Beta Release**
5360

54-
## Requirements
55-
- JRE 1.8 or higher
56-
- Linux, Windows
57-
- Mac OS
61+
----
62+
63+
## Installation
64+
65+
Once you have downloaded the [release binaries](https://github.com/coderarjob/kpdfsync/releases), and the minimum requirements are met,
66+
to start Kpdfsync, execute the `kpdfsync` file in Linux/Mac OS or `kpdfsync.bat` in Windows.
67+
68+
### Minimum requirements
69+
- JRE 1.8 __Note: JRE headless will not work.__
70+
- Linux, Windows 7, Mac OS Sierra(\*)
71+
- Linux: poppler-utils(\*\*)
72+
- Windows: poppler-utils(\*\*) is included with the release. (will work out of the box)
73+
74+
(\*) PDF fixing feature does not work on Mac OS.
75+
(\*\*) Required only for PDF fixing feature.
76+
77+
----
5878

59-
**Note:** PDF fixing feature is not available on the Mac.
79+
## Building from source
6080

61-
#### For fixing feature to work, you require the following:
62-
* Linux: poppler-utils
63-
* Windows: poppler-utils is included with the release.
64-
* Mac OS: __Not supported__
81+
### Minimum requirements
82+
- Linux, Windows 7, Mac OS Sierra
83+
- JDK 8
84+
- CMake 3.10
6585

66-
**Note:** This is a new feature, which can resolve few of the PDF errors, but not all. New fixes
67-
will be added later on.
86+
### Steps
87+
88+
Clone the repo or download the source. Then to build, run the following command at the top-level of
89+
the source directory.
90+
91+
This will build jar files in `build/bin` directory, then run `build/bin/coderarjob.kpdfsync.jar`.
92+
93+
```
94+
$ cmake -Bbuild
95+
$ cd build
96+
$ cmake --build . run
97+
```
98+
99+
----
100+
101+
## Troubleshooting
102+
103+
* (Windows) Error: api-ms-win-crt-runtime-l1-1-0.dll is missing.
104+
Install (Update for Universal C Runtime)[https://support.microsoft.com/en-us/kb/2999226]
68105

69106
## Troubleshooting
70107

@@ -76,3 +113,5 @@ Install [Update for Universal C Runtime](https://support.microsoft.com/en-us/kb/
76113
* PDF Clown library is used to read and highlight on PDF files. PDF Clown library is covered under
77114
LGPL (GNU Lesser General Public License).
78115
More information and source code can be found here [http://www.pdfclown.org](http://www.pdfclown.org)
116+
117+
* Poppler is covered under GPL3 license.

TODO

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,75 @@ Kpdfsync
2828
ByteOrderMarkTypes enum. It is now separe in
2929
ByteOrderMark file.
3030
# BUGS:
31+
[X] (GitHub Issue #9)
32+
Book: Steve Jobs (MOBI)
33+
Highlights and notes are not getting automatically mapped
34+
35+
On some pages, getting the yellow exclamation point,
36+
indicating that there are nore notes than highlight.
37+
However that is not the case in the Clippings file.
38+
39+
Cause:
40+
HighlightNotePairManager.pairAutomatic() loops though each PageResource
41+
and calls pairAutomatic on it. This loop stops at the 1st error, so if
42+
a pairAutomatic call fails, all subsequent page resources are not paired
43+
automatically.
44+
This came to light due to the below `#8` bug. Because that exception
45+
is thrown before, no page resource after that is paired automatically.
46+
47+
Solution:
48+
1. Do not break the loop on exception. Skip the page resource which
49+
cannot be mapped and go to the next. The message box with the error
50+
will not appear at that point, but the `Bug` icon will be there.
51+
52+
2. Have a method in PageResource to dry run automatic pairing, if
53+
this function returns false, skep it.
54+
55+
[ ] (GitHub Issue #8)
56+
Book: Steve Jobs (MOBI)
57+
Invalid. There are more notes than highlights
58+
59+
Invalid. There are more notes than highlights is wrongly
60+
reported even when there is no issue in the Clippings.txt
61+
file.
62+
63+
Cause:
64+
On multi page highlights, there are two location numbers in
65+
the clippings file. If there is also a note associated with
66+
the highlight, it however has only one page in the clippings
67+
file.
68+
Say the highlights are on page 1107-1108 and the note is on
69+
1108. Kpdfsync will parse and read the 1st location number
70+
of the highlight and the only location number of the note.
71+
Which means, highlight location will be 1107 and note
72+
locaiton will be 1108. Thus the error - A single note in a
73+
page.
74+
75+
Note that, if there was one highligh in 1108-1108 page, then
76+
the user will see no error message, but 1108 will have note
77+
whose assiciated highlight is in page 1107. See solution.
78+
79+
[Kindle does not do multipage highlights on PDF files, so this
80+
issue not possible in PDF files]
81+
82+
Solution:
83+
1. When double clicking on a highlight, allow notes from other
84+
pages to be associated with - in which case move the note to the
85+
page of the highlight.
86+
87+
2. When clicking a page which more notes than highlights, we get
88+
an error. After the error, show the NotesHighlights Map dialog and
89+
which will show the notes in the page, then allow selected notes
90+
to be moved to a different page.
91+
92+
Both this options will move the note to a different page and this
93+
solving the error. Option 1 starts which the highlight, option 2
94+
starts from the note, thats all the difference. In both cases the
95+
user need to know the page of the offending note or the correct
96+
page where the associated highlight resides.
97+
I prefer the 1st option, because it is easy to know the page of the
98+
offending note.
99+
31100
[ ] The string matching algo is too simple, and gives wrong match
32101
percentage, if the strings being compared differ in the number
33102
of non-whitespace characters. The two indexes get out of sync
@@ -277,4 +346,8 @@ java.io.EOFException
277346

278347
Solution:
279348
Modifed pdfclown to treat 'name' and 'post' tables as optional. It is
280-
released with kpdfsync 0.8.2-alpha.
349+
released with kpdfsync 0.9.0-alpha.
350+
351+
[ ] Book: Rust Programming Language (Duplicate issue)
352+
Highlight is not visible on the output PDF file. The 'Annotations' list shows that the
353+
highlights and comments exits (comments contents match) but are not visible.

build.sh

Lines changed: 0 additions & 104 deletions
This file was deleted.

build/Manifest.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)