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

C# xmp.XmpArray类代码示例

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

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



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

示例1: CreatePdf

// ---------------------------------------------------------------------------
/**
 * Creates a PDF document.
 */
    public byte[] CreatePdf() {
      using (MemoryStream ms = new MemoryStream()) {
        // step 1
        using (Document document = new Document()) {
        // step 2
          PdfWriter writer = PdfWriter.GetInstance(document, ms);
          using (MemoryStream msXmp = new MemoryStream()) {
            XmpWriter xmp = new XmpWriter(msXmp);
            XmpSchema dc = new DublinCoreSchema();
            XmpArray subject = new XmpArray(XmpArray.UNORDERED);
            subject.Add("Hello World");
            subject.Add("XMP & Metadata");
            subject.Add("Metadata");
            dc.SetProperty(DublinCoreSchema.SUBJECT, subject);
            xmp.AddRdfDescription(dc);
            PdfSchema pdf = new PdfSchema();
/*
 *  iTextSharp uses Item property instead of Java setProperty() method
 * 
 *      pdf.SetProperty(PdfSchema.KEYWORDS, "Hello World, XMP, Metadata");
 *      pdf.SetProperty(PdfSchema.VERSION, "1.4");
 */
            pdf[PdfSchema.KEYWORDS] = "Hello World, XMP, Metadata";
            pdf[PdfSchema.VERSION] = "1.4";
            xmp.AddRdfDescription(pdf);
            xmp.Close();
            writer.XmpMetadata = ms.ToArray();
          }
          // step 3
          document.Open();
          // step 4
          document.Add(new Paragraph("Hello World"));
        }
        return ms.ToArray();
      }
    }
开发者ID:kuujinbo,项目名称:iTextInAction2Ed,代码行数:40,代码来源:MetadataXmp.cs


示例2: SetProperty

 public void SetProperty(string key, XmpArray value)
 {
     base[key] = value.ToString();
 }
开发者ID:mapo80,项目名称:iTextSharp-Monotouch,代码行数:4,代码来源:XmpSchema.cs


示例3: AddIdentifiers

 /** Adds the identifier.
 * @param id
 */
 virtual public void AddIdentifiers(String[] id) {
     XmpArray array = new XmpArray(XmpArray.UNORDERED);
     for (int i = 0; i < id.Length; i++) {
         array.Add(id[i]);
     }
     SetProperty(IDENTIFIER, array);
 }
开发者ID:joshaxey,项目名称:Simple-PDFMerge,代码行数:10,代码来源:XmpBasicSchema.cs


示例4: AddTitle

 /**
 * Adds a title.
 * @param title
 */
 public void AddTitle(String title)
 {
     XmpArray array = new XmpArray(XmpArray.ALTERNATIVE);
     array.Add(title);
     SetProperty(TITLE, array);
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:10,代码来源:DublinCoreSchema.cs


示例5: addSubject

 /**
 * Adds a subject.
 * @param subject array of subjects
 */
 public void addSubject(String[] subject)
 {
     XmpArray array = new XmpArray(XmpArray.UNORDERED);
     for (int i = 0; i < subject.Length; i++) {
         array.Add(subject[i]);
     }
     SetProperty(SUBJECT, array);
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:12,代码来源:DublinCoreSchema.cs


示例6: AddSubject

 /**
 * Adds a subject.
 * @param subject
 */
 public void AddSubject(String subject)
 {
     XmpArray array = new XmpArray(XmpArray.UNORDERED);
     array.Add(subject);
     SetProperty(SUBJECT, array);
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:10,代码来源:DublinCoreSchema.cs


示例7: AddPublisher

 /**
 * Adds an array of publishers.
 * @param publisher
 */
 public void AddPublisher(String[] publisher)
 {
     XmpArray array = new XmpArray(XmpArray.ORDERED);
     for (int i = 0; i < publisher.Length; i++) {
         array.Add(publisher[i]);
     }
     SetProperty(PUBLISHER, array);
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:12,代码来源:DublinCoreSchema.cs


示例8: AddDescription

 /**
 * Adds a description.
 * @param desc
 */
 public void AddDescription(String desc)
 {
     XmpArray array = new XmpArray(XmpArray.ALTERNATIVE);
     array.Add(desc);
     SetProperty(DESCRIPTION, array);
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:10,代码来源:DublinCoreSchema.cs


示例9: AddAuthor

 /**
 * Adds an array of authors.
 * @param author
 */
 public void AddAuthor(String[] author)
 {
     XmpArray array = new XmpArray(XmpArray.ORDERED);
     for (int i = 0; i < author.Length; i++) {
         array.Add(author[i]);
     }
     SetProperty(CREATOR, array);
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:12,代码来源:DublinCoreSchema.cs


示例10: DeprecatedLogicTest

        virtual public void DeprecatedLogicTest() {
            String fileName = "xmp_metadata_deprecated.pdf";
            // step 1
            Document document = new Document();
            // step 2
            PdfWriter writer = PdfAWriter.GetInstance(document, new FileStream(OUT_FOLDER + fileName, FileMode.Create),
                                                      PdfAConformanceLevel.PDF_A_2B);
            MemoryStream os = new MemoryStream();
            XmpWriter xmp = new PdfAXmpWriter(os, PdfAConformanceLevel.PDF_A_2B, writer);
            XmpSchema dc = new DublinCoreSchema();
            XmpArray subject = new XmpArray(XmpArray.UNORDERED);
            subject.Add("Hello World");
            subject.Add("XMP & Metadata");
            subject.Add("Metadata");
            dc.SetProperty(DublinCoreSchema.SUBJECT, subject);
            xmp.AddRdfDescription(dc.Xmlns, dc.ToString());
            PdfSchema pdf = new PdfSchema();
            pdf.AddKeywords("Hello World, XMP & Metadata, Metadata");
            pdf.AddVersion("1.4");
            xmp.AddRdfDescription(pdf);
            xmp.Close();
            writer.XmpMetadata = os.ToArray();
            // step 3
            document.Open();
            document.AddLanguage("en_US");
            // step 4
            Font font = FontFactory.GetFont("../../resources/text/pdfa/FreeMonoBold.ttf", BaseFont.WINANSI,
                                            BaseFont.EMBEDDED, 12);
            document.Add(new Paragraph("Hello World", font));

            FileStream iccStream = new FileStream("../../resources/text/pdfa/sRGB Color Space Profile.icm",
                                                 FileMode.Open);
            ICC_Profile icc = ICC_Profile.GetInstance(iccStream);
            iccStream.Close();

            writer.SetOutputIntents("Custom", "", "http://www.color.org", "sRGB IEC61966-2.1", icc);
            // step 5
            document.Close();
            CompareResults("xmp_metadata_deprecated.pdf", fileName);
        }
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:40,代码来源:PdfAXmpWriterTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# parser.XMLParser类代码示例发布时间:2022-05-26
下一篇:
C# document.RtfDocument类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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