• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PdfAConformanceLevel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PdfAConformanceLevel的典型用法代码示例。如果您正苦于以下问题:C# PdfAConformanceLevel类的具体用法?C# PdfAConformanceLevel怎么用?C# PdfAConformanceLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PdfAConformanceLevel类属于命名空间,在下文中一共展示了PdfAConformanceLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PdfAStamperImp

 /**
  * Creates new PdfStamperImp.
  * @param reader reads the PDF
  * @param os the output destination
  * @param pdfVersion the new pdf version or '\0' to keep the same version as the original document
  * @param append
  * @param conformanceLevel PDF/A conformance level of a new PDF document
  * @throws DocumentException on error
  * @throws IOException
  */
 internal PdfAStamperImp(PdfReader reader, Stream os, char pdfVersion, bool append, PdfAConformanceLevel conformanceLevel)
     : base(reader, os, pdfVersion, append)
 {
     ((IPdfAConformance)pdfIsoConformance).SetConformanceLevel(conformanceLevel);
     PdfAWriter.SetPdfVersion(this, conformanceLevel);
     ReadPdfAInfo();
 }
开发者ID:unifamz,项目名称:UniversityManagementSystem,代码行数:17,代码来源:PdfAStamperImp.cs


示例2: SetConformanceLevel

 /**
  * @see PdfAConformance#setConformanceLevel(com.itextpdf.text.pdf.PdfAConformanceLevel)
  */
 virtual public void SetConformanceLevel(PdfAConformanceLevel conformanceLevel) {
     this.conformanceLevel = conformanceLevel;
     switch(this.conformanceLevel) {
         case PdfAConformanceLevel.PDF_A_1A:
         case PdfAConformanceLevel.PDF_A_1B:
             pdfAChecker = new PdfA1Checker(conformanceLevel);
             break;
         case PdfAConformanceLevel.PDF_A_2A:
         case PdfAConformanceLevel.PDF_A_2B:
         case PdfAConformanceLevel.PDF_A_2U:
             pdfAChecker = new PdfA2Checker(conformanceLevel);
             break;
         case PdfAConformanceLevel.PDF_A_3A:
         case PdfAConformanceLevel.PDF_A_3B:
         case PdfAConformanceLevel.PDF_A_3U:
             pdfAChecker = new PdfA3Checker(conformanceLevel);
             break;
         case PdfAConformanceLevel.ZUGFeRD:
         case PdfAConformanceLevel.ZUGFeRDComfort:
         case PdfAConformanceLevel.ZUGFeRDBasic:
         case PdfAConformanceLevel.ZUGFeRDExtended:
             pdfAChecker = new ZugferdChecker(conformanceLevel);
             break;
         default:
             pdfAChecker = new PdfA1Checker(conformanceLevel);
             break;
     }
 }
开发者ID:newlysoft,项目名称:itextsharp,代码行数:31,代码来源:PdfAConformanceImp.cs


示例3: CreatePdfA

                public void CreatePdfA(PdfAConformanceLevel level) {
                    Document doc = new Document();

                    MemoryStream stream = new MemoryStream();
                    PdfAWriter writer = PdfAWriter.GetInstance(doc, stream, level);

                    doc.Open();

                    ICC_Profile icc = ICC_Profile.GetInstance(File.Open(RESOURCES + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read, FileShare.Read));
                    writer.SetOutputIntents("Custom", "", "http://www.color.org", "sRGB IEC61966-2.1", icc);
                    writer.CreateXmpMetadata();

                    Font font = FontFactory.GetFont("FreeSans", BaseFont.IDENTITY_H, true, 12);
                    doc.Add(new Phrase("Hello, " + level + " world!", font));
                    doc.Add(new Phrase(Guid.NewGuid().ToString(), font));

                    doc.Close();
                }
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:18,代码来源:ConcurrentWriterTest.cs


示例4: PdfObjectCheck

        // This method is used in the PdfA2CheckerTest and PdfA3CheckerTest, too
        public static void PdfObjectCheck(string output, PdfAConformanceLevel level, bool exceptionExpected)
        {
            FileStream fos = new FileStream(output, FileMode.Create);

            Document document = new Document();

            PdfAWriter writer = PdfAWriter.GetInstance(document, fos, level);
            writer.CreateXmpMetadata();

            document.Open();

            Font font = FontFactory.GetFont(RESOURCES + "FreeMonoBold.ttf", BaseFont.WINANSI, BaseFont.EMBEDDED, 12);
            document.Add(new Paragraph("Hello World", font));

            FileStream iccProfileFileStream = File.Open(RESOURCES + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read, FileShare.Read);
            ICC_Profile icc = ICC_Profile.GetInstance(iccProfileFileStream);
            iccProfileFileStream.Close();

            writer.SetOutputIntents("Custom", "", "http://www.color.org", "sRGB IEC61966-2.1", icc);

            PdfArray array = new PdfArray();
            for (int i = 0; i < 8192; i++)
            {
                array.Add(new PdfNull());
            }
            writer.ExtraCatalog.Put(new PdfName("TestArray"), array);

            bool exceptionThrown = false;
            try
            {
                document.Close();
            }
            catch (PdfAConformanceException e)
            {
                if (e.GetObject().Equals(array))
                    exceptionThrown = true;
            }
            if (exceptionThrown != exceptionExpected) {
                String error = exceptionExpected ? "" : " not";
                error = String.Format("PdfAConformanceException should{0} be thrown.", error);

                Assert.Fail(error);
            }
        }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:45,代码来源:PdfA1CheckerTest.cs


示例5: PdfACopy

  /**
  * Constructor
  *
  * @param document document
  * @param os       outputstream
  */
 public PdfACopy(Document document, Stream os, PdfAConformanceLevel conformanceLevel) : base(document, os) {
     ((IPdfAConformance) pdfIsoConformance).SetConformanceLevel(conformanceLevel);
     PdfAWriter.SetPdfVersion(this, conformanceLevel);
 }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:10,代码来源:PdfACopy.cs


示例6: PdfAStamper

 /**
  * Starts the process of adding extra content to an existing PDF document keeping the document PDF/A conformant.
  * @param reader the original document. It cannot be reused
  * @param os the output stream
  * @param pdfVersion the new pdf version or '\0' to keep the same version as the original document
  * @param append if <CODE>true</CODE> appends the document changes as a new revision. This is only useful for multiple signatures as nothing is gained in speed or memory
  * @param conformanceLevel PDF/A conformance level of a new PDF document
  * @throws DocumentException on error
  * @throws IOException or error
  */
 public PdfAStamper(PdfReader reader, Stream os, char pdfVersion, bool append, PdfAConformanceLevel conformanceLevel)
 {
     stamper = new PdfAStamperImp(reader, os, pdfVersion, append, conformanceLevel);
 }
开发者ID:jagruti23,项目名称:itextsharp,代码行数:14,代码来源:PdfAStamper.cs


示例7: AddRdfDescription

 /**
  * Adds information about the PDF/A conformance level to the XMP metadata.
  *
  * @param conformanceLevel
  * @throws IOException
  */
 private void AddRdfDescription(PdfAConformanceLevel conformanceLevel)
 {
     switch (conformanceLevel) {
         case PdfAConformanceLevel.PDF_A_1A:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "1");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "A");
             break;
         case PdfAConformanceLevel.PDF_A_1B:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "1");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "B");
             break;
         case PdfAConformanceLevel.PDF_A_2A:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "2");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "A");
             break;
         case PdfAConformanceLevel.PDF_A_2B:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "2");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "B");
             break;
         case PdfAConformanceLevel.PDF_A_2U:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "2");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "U");
             break;
         case PdfAConformanceLevel.PDF_A_3A:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "3");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "A");
             break;
         case PdfAConformanceLevel.PDF_A_3B:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "3");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "B");
             break;
         case PdfAConformanceLevel.PDF_A_3U:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "3");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "U");
             break;
         case PdfAConformanceLevel.ZUGFeRD:
         case PdfAConformanceLevel.ZUGFeRDBasic:
         case PdfAConformanceLevel.ZUGFeRDComfort:
         case PdfAConformanceLevel.ZUGFeRDExtended:
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.PART, "3");
             xmpMeta.SetProperty(XmpConst.NS_PDFA_ID, PdfAProperties.CONFORMANCE, "B");
             IXmpMeta taggedExtensionMetaComfort = XmpMetaFactory.ParseFromString(getZugfredExtension(conformanceLevel));
             XmpUtils.AppendProperties(taggedExtensionMetaComfort, xmpMeta, true, false);
             break;
         default:
             break;
     }
     if (writer.IsTagged()) {
         IXmpMeta taggedExtensionMeta = XmpMetaFactory.ParseFromString(pdfUaExtension);
         XmpUtils.AppendProperties(taggedExtensionMeta, xmpMeta, true, false);
     }
 }
开发者ID:unifamz,项目名称:UniversityManagementSystem,代码行数:58,代码来源:PdfAXmpWriter.cs


示例8: CheckStructure

 public static bool CheckStructure(PdfAConformanceLevel conformanceLevel) {
     return conformanceLevel == PdfAConformanceLevel.PDF_A_1A
         || conformanceLevel == PdfAConformanceLevel.PDF_A_2A
         || conformanceLevel == PdfAConformanceLevel.PDF_A_3A;
 }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:5,代码来源:PdfAChecker.cs


示例9: ZugferdChecker

 protected internal ZugferdChecker(PdfAConformanceLevel conformanceLevel) : base(conformanceLevel) {
 }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:2,代码来源:ZugferdChecker.cs


示例10: PdfATtfUnicodeWriter

 /**
  * @see TtfUnicodeWriter#TtfUnicodeWriter(PdfWriter)
  */
 public PdfATtfUnicodeWriter(PdfWriter writer, PdfAConformanceLevel pdfAConformanceLevel)
     : base(writer) {
     this.pdfAConformanceLevel = pdfAConformanceLevel;
 }
开发者ID:htlp,项目名称:itextsharp,代码行数:7,代码来源:PdfATtfUnicodeWriter.cs


示例11: PdfAChecker

 internal PdfAChecker(PdfAConformanceLevel conformanceLevel) {
     keysForCheck = InitKeysForCheck();
     this.conformanceLevel = conformanceLevel;
 }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:4,代码来源:PdfAChecker.cs


示例12: CreateSignature

 /**
  * Applies a digital signature to a document, possibly as a new revision, making
  * possible multiple signatures. The returned PdfStamper
  * can be used normally as the signature is only applied when closing.
  * <p>
  * A possible use for adding a signature without invalidating an existing one is:
  * <p>
  * <pre>
  * KeyStore ks = KeyStore.getInstance("pkcs12");
  * ks.load(new FileInputStream("my_private_key.pfx"), "my_password".toCharArray());
  * String alias = (String)ks.aliases().nextElement();
  * PrivateKey key = (PrivateKey)ks.getKey(alias, "my_password".toCharArray());
  * Certificate[] chain = ks.getCertificateChain(alias);
  * PdfReader reader = new PdfReader("original.pdf");
  * FileOutputStream fout = new FileOutputStream("signed.pdf");
  * PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0', new
  * File("/temp"), true);
  * PdfSignatureAppearance sap = stp.getSignatureAppearance();
  * sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
  * sap.setReason("I'm the author");
  * sap.setLocation("Lisbon");
  * // comment next line to have an invisible signature
  * sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null);
  * stp.close();
  * </pre>
  * @param reader the original document
  * @param os the output stream or <CODE>null</CODE> to keep the document in the temporary file
  * @param pdfVersion the new pdf version or '\0' to keep the same version as the original
  * document
  * @param tempFile location of the temporary file. If it's a directory a temporary file will be created there.
  *     If it's a file it will be used directly. The file will be deleted on exit unless <CODE>os</CODE> is null.
  *     In that case the document can be retrieved directly from the temporary file. If it's <CODE>null</CODE>
  *     no temporary file will be created and memory will be used
  * @param append if <CODE>true</CODE> the signature and all the other content will be added as a
  * new revision thus not invalidating existing signatures
  * @param conformanceLevel PDF/A conformance level of a new PDF document
  * @return a <CODE>PdfAStamper</CODE>
  * @throws DocumentException on error
  * @throws IOException on error
  */
 public static PdfAStamper CreateSignature(PdfReader reader, Stream os, char pdfVersion, String tempFile, bool append, PdfAConformanceLevel conformanceLevel)
 {
     PdfAStamper stp;
     if (tempFile == null) {
         ByteBuffer bout = new ByteBuffer();
         stp = new PdfAStamper(reader, bout, pdfVersion, append, conformanceLevel);
         stp.sigApp = new PdfSignatureAppearance(stp.stamper);
         stp.sigApp.Sigout = bout;
     } else {
         if (Directory.Exists(tempFile)) {
             tempFile = Path.Combine(tempFile, Path.GetTempFileName());
             tempFile += ".pdf";
         }
         FileStream fout = new FileStream(tempFile, FileMode.Create);
         stp = new PdfAStamper(reader, fout, pdfVersion, append, conformanceLevel);
         stp.sigApp = new PdfSignatureAppearance(stp.stamper);
         stp.sigApp.SetTempFile(tempFile);
     }
     stp.sigApp.Originalout = os;
     stp.sigApp.SetStamper(stp);
     stp.hasSignature = true;
     PdfDictionary catalog = reader.Catalog;
     PdfDictionary acroForm = (PdfDictionary) PdfReader.GetPdfObject(catalog.Get(PdfName.ACROFORM), catalog);
     if (acroForm != null) {
         acroForm.Remove(PdfName.NEEDAPPEARANCES);
         stp.stamper.MarkUsed(acroForm);
     }
     return stp;
 }
开发者ID:jagruti23,项目名称:itextsharp,代码行数:69,代码来源:PdfAStamper.cs


示例13: PdfAXmpWriter

 /**
  * Creates and XMP writer that adds info about the PDF/A conformance level.
  *
  * @param os
  * @param info
  * @param conformanceLevel
  * @throws IOException
  */
 public PdfAXmpWriter(Stream os, IDictionary<String, String> info, PdfAConformanceLevel conformanceLevel, PdfWriter writer)
     : base(os, info)
 {
     this.writer = writer;
     try {
         AddRdfDescription(conformanceLevel);
     }
     catch (XmpException xmpExc) {
         throw new IOException(xmpExc.Message);
     }
 }
开发者ID:unifamz,项目名称:UniversityManagementSystem,代码行数:19,代码来源:PdfAXmpWriter.cs


示例14: getZugfredExtension

 private String getZugfredExtension(PdfAConformanceLevel conformanceLevel)
 {
     switch (conformanceLevel) {
         case PdfAConformanceLevel.ZUGFeRD:
         case PdfAConformanceLevel.ZUGFeRDBasic:
             return String.Format(zugferdExtension, "BASIC");
         case PdfAConformanceLevel.ZUGFeRDComfort:
             return String.Format(zugferdExtension, "COMFORT");
         case PdfAConformanceLevel.ZUGFeRDExtended:
             return String.Format(zugferdExtension, "EXTENDED");
         default:
             return null;
     }
 }
开发者ID:unifamz,项目名称:UniversityManagementSystem,代码行数:14,代码来源:PdfAXmpWriter.cs


示例15: PdfASmartCopy

 /**
  * Constructor
  *
  * @param document         document
  * @param os               outputstream
  * @param conformanceLevel
  */
 public PdfASmartCopy(Document document, Stream os, PdfAConformanceLevel conformanceLevel) : base(document, os, conformanceLevel) {
     this.streamMap = new Dictionary<PdfSmartCopy.ByteStore, PdfIndirectReference>();
 }
开发者ID:newlysoft,项目名称:itextsharp,代码行数:10,代码来源:PdfASmartCopy.cs



注:本文中的PdfAConformanceLevel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PdfArray类代码示例发布时间:2022-05-24
下一篇:
C# PccMsg类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap