10-23-2010, 12:03 PM | #1 |
.~^пиратка^~.
Posts: 238
Karma: 14000
Join Date: Sep 2009
Location: Ask NSA...
Device: Onyx Boox M92
|
Convert Double sided PDF (duplex) to single sided only?
I have some scanned books which display two pages in landscape rather than one side in portrait as normal.
The text is too small for my eReader and I want to convert the duplex to single sided only. I cannot find a way to do this. Any help appreciated! I am on Windows 7 and have full Acrobat running on this machine. I am looking for a way to do this as a batch job, per book. I don't want to cut and page pages in Acrobat one-by-one. Please does anyone know how to do this and can you help with a easy explanation? Double sided scan, landscape (I don't want this!) Single page portrait (this is what I want!) Last edited by martienne; 10-23-2010 at 12:17 PM. |
10-23-2010, 03:35 PM | #2 |
.~^пиратка^~.
Posts: 238
Karma: 14000
Join Date: Sep 2009
Location: Ask NSA...
Device: Onyx Boox M92
|
This Perl Script does it. I don't know anything about Perl but managed to get it working on Windows 7. You have to first install the Perl framework and then something called PDF::API2 - a kind of library, I think. You save the file with the extension .pl and simply run it.
This is the script. You can see where I have made changes. Code:
#!/usr/bin/env perl use strict; use warnings; use PDF::API2; my $filename = shift || 'E:\E-BOOKS\~Travel Guides\Ukraina\ukraine-getting-started.pdf'; my $oldpdf = PDF::API2->open($filename); my $newpdf = PDF::API2->new; for my $page_nb (1..$oldpdf->pages) { my ($page, @cropdata); $page = $newpdf->importpage($oldpdf, $page_nb); @cropdata = $page->get_mediabox; $cropdata[2] /= 2; $page->cropbox(@cropdata); $page->trimbox(@cropdata); $page->mediabox(@cropdata); $page = $newpdf->importpage($oldpdf, $page_nb); @cropdata = $page->get_mediabox; $cropdata[0] = $cropdata[2] / 2; $page->cropbox(@cropdata); $page->trimbox(@cropdata); $page->mediabox(@cropdata); } (my $newfilename = $filename) =~ s/(.*)\.(\w+)$/$1.clean.$2/; $newpdf->saveas('E:\E-BOOKS\~Travel Guides\Ukraina\started.pdf'); __END__ A TOOL WITH A GUI WOULD BE NICE, THOUGH! Anyone knows of one? |
Advert | |
|
10-23-2010, 03:36 PM | #3 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
Use BRISS.
I'll present all similar pages on a simple overlay. You describe each crop region (you can make it the whole half page if you want, but you might want to take out a lot of the margins too). And it'll turn each rectange you select into a page. |
10-23-2010, 05:00 PM | #4 |
.~^пиратка^~.
Posts: 238
Karma: 14000
Join Date: Sep 2009
Location: Ask NSA...
Device: Onyx Boox M92
|
Thanks! That works too!
In fact, the script doesn't seem to work too well with larger files, not sure why. Briss on the other hand, works. Interesting choice of name..........;-) Can I create some kind of Bat file for starting it? My programming days are over and I don't want to use the command prompt if I can use a shortcut.. The path for the jar files are: D:\Program Files\BRISS>java -jar briss-0.0.11.jar Briss is a great piece of code, but I wish it could get a bit more polished.... Big thanks to whoever took the time to write it... Last edited by martienne; 10-23-2010 at 05:37 PM. |
10-23-2010, 05:31 PM | #5 | |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
Quote:
Code:
java -jar "D:\Program Files\BRISS\briss-0.0.11.jar" But if you have more questions about BRISS, you might as well ask in the BRISS thread. |
|
Advert | |
|
10-26-2010, 08:28 PM | #6 |
quantum mechanic
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
|
Yes, I've tried PDFcrop and soPDF. They both work fine. I believe I found them both on mobileread so they should be easy to find. Briss is nice too. soPDF had a nice GUI written for it by a MR member (in the same thread). To my knowledge, soPDF is only available as an attachment to a post here (and nowhere else on the web).
By the way, the nice thing about soPDF is that it preserves text as text even with crazy reorientations and crops. |
10-26-2010, 09:54 PM | #7 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
soPDF is here -- the GUI I wrote for it is here. (I'm going to arrogantly assume that's the one you meant; thanks for liking it! Another GUI is available here.) However, I don't really think of soPDF as a tool for splitting a duplex PDF into parts; the splitting options are meant for splitting a single page up so that it fits on a reader in landscape mode. Though I guess it's possible you might luck out and it would split a duplex one just where you wanted to as well.
|
10-26-2010, 10:08 PM | #8 | |
quantum mechanic
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
|
Quote:
By the way, when I said "PDFcrop", I actually meant to say "Papercrop" . *Sigh* it's been a long day. You're right about soPDF by itself being a little hit and miss for this specific purpose. I think what I did (I'll have to go home and check this) was run it through soPDF and then papercrop to process 2-column journal articles to read on a nook. Or at least, some combination of this. I should be able to figure out what I did once I look at my batch files at home. I'll post an update soon. I may even have had a batch file in my send to folder to do all this automatically but I was doing so many things at the time, I forget which method actually worked. |
|
10-27-2010, 09:42 PM | #9 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
|
10-27-2010, 09:49 PM | #10 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
I must be daft, this is the second time I've seen somebody sinker at the name, but I'm clueless at the joke...is there some European innuendo with the name?
Back to the topic. I'm real lazy and can be bother with GUI or command line, I just want to drag and drop my PDF and have them converted for me. I've written a Javascript file (WPS) that works with soPDF. Where all you have to do is drag and drop the file over the script and it will call soPDF with the correct params. The params are based on the PDF file name 'Author - Book Title' If you've found your solution fine, but if you would like the script let me know and I'll post it up here. =X= |
10-27-2010, 10:20 PM | #11 | |||
quantum mechanic
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
|
Quote:
Quote:
Quote:
|
|||
10-28-2010, 01:18 PM | #12 | |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Oh I'm feeling dizzy. Maybe I shouldn't have asked.
Quote:
You also might want to pick-up another tool called pdfbookmarks or jpdfbookmarks as my script calls them out too. What happens is soPDF removes the Bookmarks from the books, limitation of the software, so in order to preserve the bookmarks I archive them before running soPDF. Then reapply the bookmarks. My script is designed to work with pdfbookmark, but I just found a tool today called jpdfbookmark that is free. =X= |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change single quotes to double quotes | Elfwreck | Workshop | 16 | 04-26-2013 10:06 AM |
Single quotes to double quotes? | lunixer | General Discussions | 35 | 10-10-2010 05:47 AM |
0.7.7 converts double "l's" to single | stan1 | Calibre | 3 | 07-06-2010 03:03 AM |
Converting multiple HTML files into a single hyperlinked PDF? | Jürgen Hubert | Reading and Management | 6 | 01-11-2010 07:44 AM |
Convert offline websites into a single pdf? | magogo | Sony Reader | 7 | 05-12-2007 12:05 PM |