Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using pdf2djvu to convert a pdf file into a djvu file, but got this error while trying to convert either bundled or indirect multi-page djvu file:

$ pdf2djvu 1.pdf -o 1.djvu
1.pdf:
- page #1 -> #1
Bogus memory allocation size

$ pdf2djvu 1.pdf -i 1.djvu
1.pdf:
- page #1 -> #1
Bogus memory allocation size

I was wondering what is wrong here and how I shall fix the problem? You can suggest another application other than pdf2djvu. To convert it to djvu

My pdf file can be downloaded from here , in case that you may wonder what is special about it.

Thanks and regards

share|improve this question

3 Answers 3

To convert djvu to pdf use DJView and export as PDF

Step - 1 : Goto software centre

Step - 2 : Install DJview4

Step - 3 : Run DJview (Applications - Graphics - DJView4)

Step - 4 : Open your .djvu document

Step - 5 : Menu - Export As: PDF enter image description here

share|improve this answer

You have to install python-djvu package and it should work. Worked for me

Good luck

John

share|improve this answer

This question is specific to pdf2djvu. pdf2djvu and other pdf/djvu FOSS tools are available for both windows and Ubuntu, so I am posting a working solution here. At the time of writing, I am using pdf2djvu on a Windows machine.

After downloading and splitting your PDF into hundreds of single-page PDFs (using pdftk), I ran pdf2djvu over all files. It turns out that only the Cover page has some problem with pdf2djvu, rest of the PDFs are easily converted to DJVU. In DOS it was a single line:

FORFILES /M *.pdf /C "cmd /c  echo. & echo @path @fname & C:\PDF\pdf2djvu-0.7.14\pdf2djvu.exe -o @fname.djvu @file"

and the result was:

"C:\Test\1\pg_0001.pdf" "pg_0001"
PDF error (81): Illegal character <3f> in hex string
PDF error (82): Illegal character <78> in hex string
PDF error (83): Illegal character <70> in hex string
...
...
PDF error (130): Illegal character <22> in hex string
PDF error (131): Illegal character <3f> in hex string
pg_0001.pdf:
- page #1 -> #1
Bogus memory allocation size

"C:\Test\1\pg_0002.pdf" "pg_0002"
pg_0002.pdf:
- page #1 -> #1
0.006 bits/pixel; 76.076:1, 98.69% saved, 437896 bytes in, 5756 bytes out

"C:\Test\1\pg_0003.pdf" "pg_0003"
pg_0003.pdf:
- page #1 -> #1
0.001 bits/pixel; 15.094:1, 93.37% saved, 14143 bytes in, 937 bytes out

"C:\Test\1\pg_0004.pdf" "pg_0004"
pg_0004.pdf:
- page #1 -> #1
0.002 bits/pixel; 6.835:1, 85.37% saved, 16875 bytes in, 2469 bytes out

"C:\Test\1\pg_0005.pdf" "pg_0005"
pg_0005.pdf:
- page #1 -> #1
0.001 bits/pixel; 15.156:1, 93.40% saved, 14141 bytes in, 933 bytes out

"C:\Test\1\pg_0006.pdf" "pg_0006"
pg_0006.pdf:
- page #1 -> #1
0.006 bits/pixel; 76.103:1, 98.69% saved, 437894 bytes in, 5754 bytes out

"C:\Test\1\pg_0007.pdf" "pg_0007"
pg_0007.pdf:
- page #1 -> #1
0.009 bits/pixel; 3.635:1, 72.49% saved, 32286 bytes in, 8882 bytes out

"C:\Test\1\pg_0008.pdf" "pg_0008"
pg_0008.pdf:
- page #1 -> #1
0.006 bits/pixel; 5.649:1, 82.30% saved, 36852 bytes in, 6524 bytes out

"C:\Test\1\pg_0009.pdf" "pg_0009"
pg_0009.pdf:
- page #1 -> #1
0.001 bits/pixel; 15.190:1, 93.42% saved, 14142 bytes in, 931 bytes out

"C:\Test\1\pg_0010.pdf" "pg_0010"
pg_0010.pdf:
- page #1 -> #1
0.010 bits/pixel; 4.485:1, 77.70% saved, 45330 bytes in, 10108 bytes out

...

So you can do the same in Ubuntu, skip the erroneous pages, and convert rest of the pages into djvu, and then bundle them back into a single DJVU file by using djvm package in Ubuntu from DJVU-Libre.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.