如何修复 pdf2djvu 中的错误:“虚假的内存分配大小”

如何修复 pdf2djvu 中的错误:“虚假的内存分配大小”

我正在pdf2djvu将 pdf 文件转换为 djvu 文件,但是在尝试转换捆绑或间接的多页 djvu 文件时出现此错误:

$ 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

我想知道这里出了什么问题,我该如何解决这个问题?您可以建议使用除 pdf2djvu 之外的其他应用程序将其转换为 djvu。

我的 pdf 文件可以从这里,你可能会想知道它有什么特别之处。

答案1

你必须安装 python-djvu 包,它才能工作。对我来说很管用

祝你好运

约翰

答案2

要将 djvu 转换为 pdf,请使用DJ查看器并导出为 PDF

步骤 1:转到软件中心

步骤 2:安装 DJview4

步骤 - 3:运行 DJview(应用程序 - 图形 - DJView4)

步骤 4:打开 .djvu 文档

步骤 - 5:菜单 - 导出为:PDF 在此处输入图片描述

答案3

这个问题特定于 pdf2djvu。pdf2djvu 和其他 pdf/djvu FOSS 工具可用于 Windows 和 Ubuntu,因此我在此发布一个可行的解决方案。在撰写本文时,我正在 Windows 机器上使用 pdf2djvu。

下载 PDF 并将其拆分为数百个单页 PDF(使用 pdftk)后,我在所有文件上运行了 pdf2djvu。结果发现只有封面页在使用 pdf2djvu 时出现了一些问题,其余 PDF 都可以轻松转换为 DJVU。在 DOS 中,它只有一行:

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

结果是:

"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

...

因此,您可以在 Ubuntu 中执行相同操作,跳过错误的页面,并将其余页面转换为 djvu,然后使用 DJVU-Libre 中的 Ubuntu 中的 djvm 包将它们捆绑回单个 DJVU 文件。

相关内容