Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 01-27-2007, 01:21 PM   #1
Bert
Enthusiast
Bert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with others
 
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
Merge scribbles with PDF

Hi all,

After waiting a while in vain for iRex to provide a program to merge scribbles with the pdf, I decided to write my own. (I found a perl-script somewhere on this forum, but I didn't want to install perl just to run a little tool like that.)

The attached app is written in java, and uses the iText library for the merging process (just like some other apps on this forum). It can merge the file while keeping the manifest, create a pdf with only scribbled pages (useful when when proofreading a document), change the scribble colors, ... .
You need at lava 1.4 at least, just unzip the attached zip and run the jar. (java -jar ILiadPdfScribbleMerger.jar, or on windows, you can just double-click the jar)[*]
Let me know if you find any problems!


Bert.

PS: This is my first post in this forum! I lurked around here for a few months, finally buying an iLiad myself in december ... I never posted because I never had anything useful to say, until now (I think ).


Updates:
  • (v1.1) Support cropped pdf's
  • (v1.2-1.3.1) Support Linux & Mac OSX
  • (v1.4) Command line merging
  • (v1.6) Preserve bookmarks etc, drag&drop files.
  • (v1.7) Save color mappings (only for GUI for now - I'll do the commandline part later)
  • (v1.7.5) Color mappings supported in command line + small bugfix (last used color map not always saved)
  • (v1.7.6) Fixed 2 bugs related with rotated pages and cropping.
  • (v1.8) Fixed a bug (corrupt pdf generated for 'scribbled pages only'), added 'open merged pdf' option.
Attached Files
File Type: zip ILiadPdfScribbleMerger v1.7.5.zip (1.79 MB, 1421 views)
File Type: zip ILiadPdfScribbleMerger v1.7.5-src.zip (1.86 MB, 1078 views)
File Type: zip ILiadPdfScribbleMerger v1.7.6.zip (2.02 MB, 1036 views)
File Type: zip ILiadPdfScribbleMerger v1.7.6-src.zip (2.12 MB, 1016 views)
File Type: zip ILiadPdfScribbleMerger v1.8.zip (2.02 MB, 1887 views)
File Type: zip ILiadPdfScribbleMerger v1.8-src.zip (2.12 MB, 1592 views)

Last edited by Bert; 02-26-2008 at 06:24 PM. Reason: Released v1.8
Bert is offline   Reply With Quote
Old 01-28-2007, 06:02 AM   #2
jęd
Evangelist
jęd has a complete set of Star Wars action figures.jęd has a complete set of Star Wars action figures.jęd has a complete set of Star Wars action figures.
 
Posts: 458
Karma: 293
Join Date: May 2006
Quote:
Originally Posted by Bert
Hi all,

After waiting a while in vain for iRex to provide a program to merge scribbles with the pdf, I decided to write my own. (I found a perl-script somewhere on this forum, but I didn't want to install perl just to run a little tool like that.)

The attached app is written in java, and uses the iText library for the merging process (just like some other apps on this forum). It can merge the file while keeping the manifest, create a pdf with only scribbled pages (useful when when proofreading a document), change the scribble colors, ... .
You need at lava 1.4 at least, just unzip the attached zip and run the jar. (java -jar ILiadPdfScribbleMerger.jar, or on windows, you can just double-click the jar)

Let me know if you find any problems!


Bert.

PS: This is my first post in this forum! I lurked around here for a few months, finally buying an iLiad myself in december ... I never posted because I never had anything useful to say, until now (I think ).
Cool... Irex are supposed to coming out with something... Have seen this...? Its an implementation in php5 and does much the same thing... I would made a Java version, but I tend to find php is better for rapid development, and java is too much like work. (I'm a Java dev and don't like using Eclipse when I supposed to be relaxing... )
jęd is offline   Reply With Quote
Advert
Old 02-02-2007, 08:37 AM   #3
yokos
Pac-Man caught my iLiad.
yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.
 
yokos's Avatar
 
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
Quote:
Originally Posted by Bert
Let me know if you find any problems!
I have one. java file starts [see screenshot], but I can't open an irex-pdf-directory as source. There is nothing to select in opened window [2nd ss].
Maybe the java binary doesn't find the 2 libraries?
I have Windows XP, jdk1.5.0_09, jre1.5.0_09, no tested on suse yet.
Nice idea to offer the replacement of colours.
Attached Thumbnails
Click image for larger version

Name:	ILiadPdfScribbleMerger 01.png
Views:	1341
Size:	8.3 KB
ID:	2781   Click image for larger version

Name:	ILiadPdfScribbleMerger 02.png
Views:	1290
Size:	16.7 KB
ID:	2783  

Last edited by yokos; 02-02-2007 at 08:47 AM.
yokos is offline   Reply With Quote
Old 02-02-2007, 02:22 PM   #4
Bert
Enthusiast
Bert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with others
 
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
That's a strange problem ... Are you sure that directory contains any directories?

The 'open file' dialog does absolutely no filtering (except that it only accepts directories), I was planning to filter on irex-pdf dirs directly with the file-chooser, but I couldn't find a way to do it. Eventually I just decided to accept all directories, and check if they are valid later on.

Let me show you the code which shows the dialog, so you can see why this is so strange:
Code:
...
        //show the file chooser
        JFileChooser fc = new JFileChooser();
        fc.setAcceptAllFileFilterUsed(false);
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        fc.setSelectedFile(fileInput);
        FileFilter ff = new FileFilter() {
            public boolean accept(File f) {
                return f.isDirectory();
            }
            
            public String getDescription() {
                return "iRex pdf directories";
            }
        };
        fc.setFileFilter(ff);
        int nReturnValue = fc.showOpenDialog(this);
...
You can see the "iRex pdf directories" file filter is superfluous, it does the same as the JFileChooser.DIRECTORIES_ONLY selection mode.

BTW: I developed this app on Windows XP SP2, with jdk1.5.0_09, and using JRE 1.5.0_09-b03. So I see no problems there.


A temporary solution: If you can't get it to work, you could always just type the complete path in the 'source' box manually, that should work also.
Bert is offline   Reply With Quote
Old 02-02-2007, 03:04 PM   #5
Kirys
Zealot
Kirys has learned how to buy an e-book online
 
Posts: 122
Karma: 86
Join Date: Dec 2006
Location: Italy
Device: Boox M90
Quote:
Originally Posted by Bert
That's a strange problem ... Are you sure that directory contains any directories?

The 'open file' dialog does absolutely no filtering (except that it only accepts directories), I was planning to filter on irex-pdf dirs directly with the file-chooser, but I couldn't find a way to do it. Eventually I just decided to accept all directories, and check if they are valid later on.
You can do it extending the java.io.FileFilter class, in the accept method you can do all the tests you need to detect if that folder is a Irex folder
then assign that class as the filter class for the dialog.
Kirys is offline   Reply With Quote
Advert
Old 02-02-2007, 05:09 PM   #6
Bert
Enthusiast
Bert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with others
 
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
Quote:
Originally Posted by Kirys
You can do it extending the java.io.FileFilter class, in the accept method you can do all the tests you need to detect if that folder is a Irex folder
then assign that class as the filter class for the dialog.
I know you can filter everything there, but if you accept only irex folders, navigating becomes impossible (the non-irex-folders won't be visible).
I was hoping you could disable the 'open' button when you select a non-irex-folder, but I don't know any easy solution for that. You could always extend the JFileChooser itself, but that was just too much work for that tiny problem .
Bert is offline   Reply With Quote
Old 02-03-2007, 10:34 PM   #7
doctorwes
Junior Member
doctorwes began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2006
Device: iRex iLiad
It works for me, and it's very useful - thank you!
doctorwes is offline   Reply With Quote
Old 02-06-2007, 08:30 AM   #8
yokos
Pac-Man caught my iLiad.
yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.
 
yokos's Avatar
 
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
Hallo, Bert, I found the error, why this wasn't working with my files:
your java program wants to have directory with ".pdf" in the end of it's name.
Most of my pdf folder don't have this, because I edit manifest.xml before opening it on iLiad [-> no .pdf in directory's name.]
Even if I type the correct path of directory in the source field, your program ignores non-.pdf-in-the-end-directories.

There is one real problem: If a pdf file is cropped [for instance 20 mm on top of page] scribble notes move 20 mm above the position they were drawn, because output is a non-cropped page. With a larger visible page size the correct scribble positions get shifted with amount of cropped length.

However, a great tool.

Sample file is attached.
Attached Files
File Type: zip sample.zip (148.3 KB, 1080 views)

Last edited by yokos; 02-08-2007 at 08:15 AM. Reason: non-native English speaker. ;-)
yokos is offline   Reply With Quote
Old 02-06-2007, 09:31 AM   #9
templario
Connoisseur
templario began at the beginning.
 
Posts: 86
Karma: 10
Join Date: Dec 2006
Device: Iliad
Just one question to yokos, why do you need to edit the manisfest.xml before opening it ont Iliad. Maybe i“m newby on this, but i don“t have the manifest.xml before opening it, it just appears after that, isn“t it?

Thanks
templario is offline   Reply With Quote
Old 02-06-2007, 09:45 AM   #10
yokos
Pac-Man caught my iLiad.
yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.
 
yokos's Avatar
 
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
Quote:
Originally Posted by templario
Just one question to yokos, why do you need to edit the manisfest.xml before opening it ont Iliad. Maybe i“m newby on this, but i don“t have the manifest.xml before opening it, it just appears after that, isn“t it?
It's just a visual gimmick, which helps a lot to navigate better through files. All important directories & pdf files should have a cover image [no way to do it on iLiad]. Editing Title & Description tag on iLiad is much to slow.
manifest templates
yokos is offline   Reply With Quote
Old 02-06-2007, 04:28 PM   #11
Bert
Enthusiast
Bert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with others
 
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
Quote:
Originally Posted by yokos
Hallo, Bert, I found the error, why this wasn't working with my files:
your java program wants to have directory with ".pdf" in the end of it's name.
Most of my pdf folder don't have this, because I edit manifest.xml before opening it on iLiad [-> no .pdf in directory's name.]
Even if I type the correct path of directory in the source field, your program ignores non-.pdf-in-the-end-directories.

There is one real problem: If a pdf file is cropped [for instance 20 mm on top of page] scribble notes move 20 mm above the position they were drawn, because output is is a non-cropped page. With a larger visible page size the correct scribble positions get shifted with amount of cropped length.
I have fixed both problems (well ... almost ).

- About the cropped PDF's: I didn't even know that was possible! However, some searching in the iText library delivered the desired results. The cropped pages from your samples are merged correctly now.
- The problem with the iRex-folders was laziness from my side: I only accepted folders ending with .pdf containing a .pdf file with an identical name. Now I accept all folders with a manifest.xml and scribble.irx in it, and search for the pdf-file in the manifest.xml file.
However, now I have another problem: some of your files contain special characters which are screwed up by windows ((like "Schöne Grüße von Vulcanus.pdf" becomes "Sch÷ne Gr³Æe von Vulcanus.pdf"). When I scan the manifest.xml file for the pdf-file I get a correct filename, but when I search for that file it isn't found (It only sees the screwed-up filename)... So these files still don't work. I'll look into that another time.
Attached Files
File Type: zip iLiadPdfScribbleMerger 1.1.zip (1.77 MB, 989 views)
Bert is offline   Reply With Quote
Old 02-08-2007, 08:06 AM   #12
yokos
Pac-Man caught my iLiad.
yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.
 
yokos's Avatar
 
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
Quote:
Originally Posted by Bert
- About the cropped PDF's: I didn't even know that was possible! However, some searching in the iText library delivered the desired results. The cropped pages from your samples are merged correctly now.
Thanks, shift of scribble notes got away. I didn't thought this would be so easy to patch.

Quote:
Originally Posted by Bert
- The problem with the iRex-folders was laziness from my side: I only accepted folders ending with .pdf containing a .pdf file with an identical name. Now I accept all folders with a manifest.xml and scribble.irx in it, and search for the pdf-file in the manifest.xml file.
Thx.

Quote:
Originally Posted by Bert
However, now I have another problem: some of your files contain special characters which are screwed up by windows ((like "Schöne Grüße von Vulcanus.pdf" becomes "Sch÷ne Gr³Æe von Vulcanus.pdf"). When I scan the manifest.xml file for the pdf-file I get a correct filename, but when I search for that file it isn't found (It only sees the screwed-up filename)... So these files still don't work. I'll look into that another time.
Special characters are the German "Umlaute". On a German Win XP your java program has no problems with my sample.
mmh, some hotchpotch of encodings: in manifest.xml utf-8 it becomes "Schƶne GrĆ¼ĆŸe von Vulcanus"; memory card/HDD fat32/ntfs; windows itself;java vm.

The function "scribbled pages only" is quite handy to get an overview what was scribbed on iLiad. Well done.
Attached Thumbnails
Click image for larger version

Name:	colour_mapping.png
Views:	1232
Size:	57.3 KB
ID:	2807  

Last edited by yokos; 02-09-2007 at 06:11 AM. Reason: utf-8
yokos is offline   Reply With Quote
Old 02-13-2007, 02:58 PM   #13
lsz
Junior Member
lsz began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2007
Mac bug?

> Let me know if you find any problems!

I tried to use your program on a Mac with OS 10.4.8 and got the following error.

java.io.FileNotFoundException: /Volumes/KINGSTON/learning-clausal-logic.pdf\manifest.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.jav a:106)
.....

Maybe there is a problem with the slash direction? Thanks.
lsz is offline   Reply With Quote
Old 02-13-2007, 04:53 PM   #14
Bert
Enthusiast
Bert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with others
 
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
Indeed, I used hardcoded backslashes in the code. I'm only used to programming in Windows evironments, and tend to forget the differences in other OS'es.

I removed all hardcoded backslashes, so it should work now. Can you check if everything works as it should? I don't have a Mac at hand here, so I can' check.
Attached Files
File Type: zip ILiadPdfScribbleMerger 1.2.zip (1.77 MB, 972 views)
Bert is offline   Reply With Quote
Old 02-13-2007, 05:26 PM   #15
lsz
Junior Member
lsz began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2007
Thanks for the quick response. The [Merge in existing file, keep manifest] option now works (and is very useful!). However, the [Create New] fails to do anything and the [Replace all] gives the following error:

java.io.FileNotFoundException: /Volumes/KINGSTON/learning-clausal-logic-copy.pdf (Directory not empty)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:179)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:70)
at iliadpdfscribblemerger.ScribbleMergeForm.copyFile( ScribbleMergeForm.java:701)
at iliadpdfscribblemerger.ScribbleMergeForm.btnMergeA ctionPerformed(ScribbleMergeForm.java:688)
......


Maybe you are not creating/deleting directories in a platform independent manner? I don't know much about how this works in Java...
lsz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge part I & II of downloaded pdf book swaneelee Calibre 4 07-01-2010 10:21 PM
DR800 PDF annotation merge tool? CoolDragon iRex 1 06-21-2010 02:56 PM
Merge feature request (different merge) Tarran Calibre 1 05-24-2010 10:57 AM
Problem with merging scribbles to PDF file MikeTr iRex 2 01-15-2010 03:45 AM
Merging Scribbles with Pdf jęd iRex 15 12-20-2006 04:40 AM


All times are GMT -4. The time now is 05:31 PM.


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