01-27-2007, 01:21 PM | #1 |
Enthusiast
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:
Last edited by Bert; 02-26-2008 at 06:24 PM. Reason: Released v1.8 |
01-28-2007, 06:02 AM | #2 | |
Evangelist
Posts: 458
Karma: 293
Join Date: May 2006
|
Quote:
|
|
Advert | |
|
02-02-2007, 08:37 AM | #3 | |
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
Quote:
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. Last edited by yokos; 02-02-2007 at 08:47 AM. |
|
02-02-2007, 02:22 PM | #4 |
Enthusiast
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); ... 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. |
02-02-2007, 03:04 PM | #5 | |
Zealot
Posts: 122
Karma: 86
Join Date: Dec 2006
Location: Italy
Device: Boox M90
|
Quote:
then assign that class as the filter class for the dialog. |
|
Advert | |
|
02-02-2007, 05:09 PM | #6 | |
Enthusiast
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
|
Quote:
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 . |
|
02-03-2007, 10:34 PM | #7 |
Junior Member
Posts: 6
Karma: 10
Join Date: Nov 2006
Device: iRex iLiad
|
It works for me, and it's very useful - thank you!
|
02-06-2007, 08:30 AM | #8 |
Pac-Man caught my iLiad.
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. Last edited by yokos; 02-08-2007 at 08:15 AM. Reason: non-native English speaker. ;-) |
02-06-2007, 09:31 AM | #9 |
Connoisseur
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 |
02-06-2007, 09:45 AM | #10 | |
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
Quote:
manifest templates |
|
02-06-2007, 04:28 PM | #11 | |
Enthusiast
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
|
Quote:
- 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. |
|
02-08-2007, 08:06 AM | #12 | |||
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
Quote:
Quote:
Quote:
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. Last edited by yokos; 02-09-2007 at 06:11 AM. Reason: utf-8 |
|||
02-13-2007, 02:58 PM | #13 |
Junior Member
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. |
02-13-2007, 04:53 PM | #14 |
Enthusiast
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. |
02-13-2007, 05:26 PM | #15 |
Junior Member
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... |
|
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 |