Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 10-23-2010, 12:03 PM   #1
martienne
.~^пиратка^~.
martienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshes
 
martienne's Avatar
 
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.
martienne is offline   Reply With Quote
Old 10-23-2010, 03:35 PM   #2
martienne
.~^пиратка^~.
martienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshes
 
martienne's Avatar
 
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?
martienne is offline   Reply With Quote
Advert
Old 10-23-2010, 03:36 PM   #3
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
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.

frabjous is offline   Reply With Quote
Old 10-23-2010, 05:00 PM   #4
martienne
.~^пиратка^~.
martienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshesmartienne can read faster than his screen refreshes
 
martienne's Avatar
 
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.
martienne is offline   Reply With Quote
Old 10-23-2010, 05:31 PM   #5
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Quote:
Originally Posted by martienne View Post
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
I don't use Windows, but I'd guess you could just open Notepad, and copy:

Code:
java -jar "D:\Program Files\BRISS\briss-0.0.11.jar"
inside, save it with a extension ending in .bat, and you'd have your batch file.

But if you have more questions about BRISS, you might as well ask in the BRISS thread.
frabjous is offline   Reply With Quote
Advert
Old 10-26-2010, 08:28 PM   #6
thrawn_aj
quantum mechanic
thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.
 
thrawn_aj's Avatar
 
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
Quote:
Originally Posted by martienne View Post

A TOOL WITH A GUI WOULD BE NICE, THOUGH! Anyone knows of one?
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.
thrawn_aj is offline   Reply With Quote
Old 10-26-2010, 09:54 PM   #7
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
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.
frabjous is offline   Reply With Quote
Old 10-26-2010, 10:08 PM   #8
thrawn_aj
quantum mechanic
thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.
 
thrawn_aj's Avatar
 
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
Quote:
Originally Posted by frabjous View Post
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.
Yes! I thought your name seemed familiar . And I did like the gui . Since then, I think I used the commandline version in batch files to do other stuff.

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.
thrawn_aj is offline   Reply With Quote
Old 10-27-2010, 09:42 PM   #9
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Quote:
Originally Posted by frabjous View Post
...I'll present all similar pages on a simple overlay. You describe each crop region (you can make it the whole half page...
Simple and Brilliant! Why didn't I think of this earlier. Whould have saved me hours of grief. Thanks!
=X= is offline   Reply With Quote
Old 10-27-2010, 09:49 PM   #10
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Quote:
Originally Posted by martienne View Post
Interesting choice of name..........;-)
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=
=X= is offline   Reply With Quote
Old 10-27-2010, 10:20 PM   #11
thrawn_aj
quantum mechanic
thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.
 
thrawn_aj's Avatar
 
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
Quote:
Originally Posted by =X= View Post
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?
Hebrew innuendo actually. And quite apropos too
Quote:
Briss - the Jewish rite of circumcision performed on a male child on the eighth day of his life

Quote:
Originally Posted by =X= View Post
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=
Please post it - I for one would love to try it out. . Thanks!
thrawn_aj is offline   Reply With Quote
Old 10-28-2010, 01:18 PM   #12
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Quote:
Originally Posted by thrawn_aj View Post
Hebrew innuendo actually. And quite apropos too
Oh I'm feeling dizzy. Maybe I shouldn't have asked.

Quote:
Originally Posted by thrawn_aj View Post
Please post it - I for one would love to try it out. . Thanks!
Okay I'll post it tonight when I get to my home PC.

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=
=X= is offline   Reply With Quote
Reply


Forum Jump

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


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


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