使用PDF小丑的PDF写入错误

PDF write error using PDF Clown

我有一个 PDF 文件,我正在使用 PDF Clown 阅读它,然后向它添加一些注释。之后,我尝试使用 org.pdfclown.files.File 的 Save 方法将文件序列化到磁盘。在这样做的过程中,我遇到了以下错误

An exception happened while running the sample: org.pdfclown.util.parsers.PostScriptParseException: Unknown type beginning: 'False' at org.pdfclown.tokens.BaseParser.ParsePdfObject() in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\tokens\BaseParser.cs:line 149 at org.pdfclown.tokens.FileParser.ParsePdfObject() in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\tokens\FileParser.cs:line 150 at org.pdfclown.tokens.FileParser.ParsePdfObject(XRefEntry xrefEntry) in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\tokens\FileParser.cs:line 221 at org.pdfclown.objects.PdfIndirectObject.get_DataObject() in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\objects\PdfIndirectObject.cs:line 275 at org.pdfclown.objects.PdfIndirectObject.WriteTo(IOutputStream stream, File context) in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\objects\PdfIndirectObject.cs:line 248 at org.pdfclown.tokens.PlainWriter.WriteStandard() in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\tokens\PlainWriter.cs:line 205 at org.pdfclown.tokens.Writer.Write(SerializationModeEnum mode) in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\tokens\Writer.cs:line 132 at org.pdfclown.files.File.Save(IOutputStream stream, SerializationModeEnum mode) in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\files\File.cs:line 315 at org.pdfclown.files.File.Save(String path, SerializationModeEnum mode) in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.lib\src\org\pdfclown\files\File.cs:line 272 at org.pdfclown.samples.cli.HelloWorldSample.UzairTestFunc() in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.samples.cli\src\org\pdfclown\samples\cli\HelloWorldSample.cs:line 40 at org.pdfclown.samples.cli.HelloWorldSample.Run() in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.samples.cli\src\org\pdfclown\samples\cli\HelloWorldSample.cs:line 20 at org.pdfclown.samples.cli.SampleLoader.Run(String inputPath, String outputPath) in d:\eProof\testProjects\pdf_clown_svn\dotNET\pdfclown.samples.cli\src\org\pdfclown\samples\cli\SampleLoader.cs:line 123

现在我无法在此处共享 PDF,但我发现它无法处理 PDF 中的以下对象
...
96 0 对象

内对象
...

知道如何在 PDF Clown 中解决这个问题吗?

96 0 obj
False
endobj

此对象无效,布尔值全部小写:

7.3.2 Boolean objects

Boolean objects represent the logical values of true and false. They appear in PDF files using the keywords true and false.

(ISO 32000-1 和 ISO 32000-2)

因此,要修复您的 PDF,请将 False 替换为 false