简体   繁体   English

使用 PDF Clown 的 PDF 写入错误

[英]PDF write error using PDF Clown

I have a PDF file which i am reading using PDF Clown and then adding some annotations to it.我有一个 PDF 文件,我正在使用 PDF Clown 阅读该文件,然后向其中添加一些注释。 After that i am trying to serialize the file to disk using Save method of org.pdfclown.files.File.之后,我尝试使用 org.pdfclown.files.File 的 Save 方法将文件序列化到磁盘。 In doing so i am getting following error在这样做时,我收到以下错误

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 运行示例时发生异常:org.pdfclown.util.parsers.PostScriptParseException:未知类型开始:'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\\pdfclo在 org.pdfclown.tokens.PlainWriter.WriteStandard() 在 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 模式)在 d:\\eProof\\testProjects\\pdf_clown_svn\\dotNET\\pdfclown.lib\\src\\org\\pdfclown\\files\\File.cs:line 315 at org.pdfclown.files.File.Save(字符串路径,SerializationModeEnum 模式)在 d:\\eProof\\testProjects\\pdf_clown_svn\\dotNET\\pdfclown.lib\\src\\org\\pdfclown\\files\\File.cs:line 272 at org.pdfclown.samples.cli.HelloWorldSample.UzairTestFunc() 在 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\\pdfclo wn\\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 wn\\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

Now i cant share the PDF here, but i see that it is not able to handle the following object in the PDF现在我无法在此处共享 PDF,但我发现它无法处理 PDF 中的以下对象
... ...
96 0 obj 96 0 目标
False错误的
endobj结束对象
... ...

Any ideas how to resolve this in PDF Clown?任何想法如何在 PDF Clown 中解决这个问题?

96 0 obj False endobj

This object is invalid, boolean values are all lowercase:这个对象无效,布尔值都是小写的:

7.3.2 Boolean objects 7.3.2 布尔对象

Boolean objects represent the logical values of true and false.布尔对象表示真假的逻辑值。 They appear in PDF files using the keywords true and false .它们使用关键字truefalse出现在 PDF 文件中。

(both ISO 32000-1 and ISO 32000-2) (ISO 32000-1 和 ISO 32000-2)

To repair your PDF, therefore, please replace False by false .因此,要修复您的 PDF,请将False替换为false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM