LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-25-2008, 09:50 AM   #1
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
ps/pdf to djvu optimal conversion [solution found]


I was going to ask what is the best way to convert pdf to djvu, because while I tried converting it different ways many produced rather crappy results. In the end, after much trial and error, I found the best way to do it that produces optimal results, so I'm going to post it in case someone else wants to know.

The best way to convert ps or pdf to djvu is using 'djvudigital' (part of djvulibre), it produces the highest quality results in the least time. However, it does require the gsdjvu driver for ghostscript. It says here how to get it and install it:
http://djvu.sourceforge.net/gsdjvu.html
download:
http://sourceforge.net/project/showf...kage_id=157188
install instructions:
http://djvu.sourceforge.net/gsdjvu/README
It cannot be included by default because it is under a license that is not GPL-compatible.

The reason I needed this conversion was because I had a large pdf that loaded EXTREMELY slowly even after optimizing it. Now that I converted it to djvu it's much faster.

Note that this method is both faster and better than any2djvu (the public server that converts things to djvu)

This conversion also helps in cases where pdf images are printed as black squares ... a waste of ink.

Last edited by H_TeXMeX_H; 01-18-2009 at 03:47 AM. Reason: added extra links and info
 
Old 01-17-2009, 07:06 PM   #2
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
great, sounds excellent.

I have a musical score in PDF, and I can't get either xpdf nor acroread to keep up with the music. Refreshing takes too much time ... on my quad ... they must be singlethreaded then so (I imagine). At the outset I didn't think a conversion would help ... but let's see.

I also see it's a hand compilation of various packages ... oops, will take time ... oh well, could be worth it. Will be doing it on my ubuntu though ... more or less have my slack abandoned these days ... no doubt to my detriment.

<later ...>
OK, gsdjvu is in .. but djvudigital (oddish name) wasn;t around, nto in ubuntu any way. Prob the usual devels left out. Hmmm, no, not really.

OK .. hand compile djvulibre. Will have multiple djvu's now. Ooops.


<later ...>
Ok, after this djvudigital came up. Right.But now there's a path problem. It can't find the ghostscript driver in gsdjvu. Eeek. I'm going through quite alot of start-stops now.

<still later ...>
Yep, unless you put the gsdjvu and gs executables into directories already in your $PATH, you have to extend your search $PATH. Really it's just those two.

results: my score no longer has any refresh problem, though the filesize is considerably bigger (400k to 2.5M).

Es war ein schwere Geburt, as the Germans might say, ... but I got there.

Good call.

Last edited by stabu; 01-17-2009 at 08:19 PM. Reason: after some investig
 
Old 01-18-2009, 03:50 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Ok, I added more links to make it easier to download and install it. Also know that there is a '--dpi=' option to set the DPI, which will affect output file size.
 
Old 01-20-2009, 04:11 PM   #4
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
Hi H_TeXMeX_H,

Once installed I started to experiment of course, and I came across this superhero presentation comparison DJVU have done http://www.djvu.com.pl/pdfanddjvu/su..._hero__pdf.htm.

Did you see that?

Of course I wanted to do it myself. So, I get the superhero.pdf conevrt to *.ps and then try the recommended command line:

Code:
djvudigital --cseparg=-p100 --words --threshold=99 --fg-image-colors=1024 --fg-colors=128 --psrotate=90 --bg-slices=72+11+10+6 superhero.ps
it fails, and then I begin fiddling, by leaving the cseparg option out, and I get a DJVU file of 1.8MB. Twice the size it should be. Sure, you can reduce it by using the dpi=100 option, to as low as 600kB, but the quality suffers, and the idea was that you whould get 900kB without compromising quality.

So, the problem (if you're still interested) is the --cspearg option. If you look up "man cseparg", well, the p option doesn't exist. aand you would need to have an equals sign after the p if you want to follow its conventions. But of course we are calling csepargs _from_djvudigital ...
so it's all a quandary, with no joy at the end.

Have you seen that? If you're interested and have a spare moment, chekc out the operation and say here if you've managed to get anything out of it.

If not, don't worry! I actually posted a query on their site ... but nobody is too interested in it. which is bizarre. I mean, it could be not true ... a propaganda exercise for DJVU, possibly.

Thanks!

Last edited by stabu; 01-20-2009 at 04:15 PM. Reason: afterthought
 
Old 01-21-2009, 11:31 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Well, I would try it, but both links on that site are down.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: gscan2pdf - Scan multiple Documents, import images to PDF & DjVu LXer Syndicated Linux News 0 08-28-2008 07:41 AM
djvu to pdf horacioemilio Linux - Software 2 08-04-2008 02:24 AM
PDF to MS Word conversion sshatz Linux - Software 5 10-25-2007 04:58 PM
PS to PDF conversion. binoykr SUSE / openSUSE 2 02-21-2007 09:26 AM
djvu exits on try to open *.djvu document deggial Linux - Software 0 04-09-2006 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration