sách gpt4 ai đã đi

pdf - iTextSharp 可以将 PDF 文档转换为 PDF/A

In lại 作者:行者123 更新时间:2023-12-04 22:04:15 32 4
mua khóa gpt4 Nike

我无法在 FAQ 中找到这个功能是否存在于 API 中,尽管它在书中提到作为潜在可用的东西。有没有人有任何实现此功能的经验?

1 Câu trả lời

hiện hữu This thread (日期为 2007 年 6 月)Paulo Soares 提供了显示对 PDF/A 支持的代码。这是 C# 代码(他还有一个 Java 示例):

private void PdfATest() {
Document doc = new Document(PageSize.A4);
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream("C:\\hello_A1-b_cs.pdf", FileMode.Create));
writer.PDFXConformance = PdfWriter.PDFA1B;
doc.Open();

PdfDictionary outi = new PdfDictionary(PdfName.OUTPUTINTENT);
outi.Put(PdfName.OUTPUTCONDITIONIDENTIFIER, new PdfString("sRGB IEC61966-2.1"));
outi.Put(PdfName.INFO, new PdfString("sRGB IEC61966-2.1"));
outi.Put(PdfName.S, PdfName.GTS_PDFA1);

// get this file here: http://old.nabble.com/attachment/10971467/0/srgb.profile
ICC_Profile icc = ICC_Profile.GetInstance("c:\\srgb.profile");
PdfICCBased ib = new PdfICCBased(icc);
ib.Remove(PdfName.ALTERNATE);
outi.Put(PdfName.DESTOUTPUTPROFILE, writer.AddToBody(ib).IndirectReference);

writer.ExtraCatalog.Put(PdfName.OUTPUTINTENTS, new PdfArray(outi));

BaseFont bf = BaseFont.CreateFont("c:\\windows\\fonts\\arial.ttf", BaseFont.WINANSI, true);
Font f = new iTextSharp.text.Font(bf, 12);
doc.Add(new Paragraph("hello", f));

writer.CreateXmpMetadata();

doc.Close();
}

上面的链接包括 ICC_Profile 文件的下载。

关于pdf - iTextSharp 可以将 PDF 文档转换为 PDF/A,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2366851/

32 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com