问题描述
我正在转换一个大约为 . 16K 行到一个 PDF/A-1b 文件中。我收到异常“PdfAConformanceException:超出最大阵列容量”。如果文档是普通 PDF 而不是 PDF/A,则生成的文档没有问题。它只会生成 PDF/A。正常的 PDF 文档大约有 1150 页长。有关如何解决此问题的任何提示?异常是在“Doc.Close()”调用中生成的。 这是我使用的代码:
StreamReader str = new StreamReader(file_name);
PdfWriter writer = new PdfWriter(file_name.Replace(".txt",".pdf"));
PdfDocument pdf = new PdfADocument(writer,PdfAConformanceLevel.PDF_A_1B,new PdfOutputIntent
("Custom","","https://www.color.org","sRGB IEC61966-2.1",new FileStream(INTENT,FileMode.Open,FileAccess.Read)));
Document doc = new Document(pdf);
pdf.SetTagged();
//Fonts need to be embedded
PdfFont font = PdfFontFactory.CreateFont(FONT,PdfEncodings.WINANSI,true);
Paragraph p = new Paragraph();
p.SetFont(font);
p.Add(str.ReadToEnd());
doc.Add(p);
doc.Close();
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)