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

C# PdfArray类代码示例

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

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



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

示例1: PdfType0Font

        public PdfType0Font(PdfDocument document, XFont font, bool vertical)
            : base(document)
        {
            Elements.SetName(Keys.Type, "/Font");
            Elements.SetName(Keys.Subtype, "/Type0");
            Elements.SetName(Keys.Encoding, vertical ? "/Identity-V" : "/Identity-H");

            OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptorFor(font);
            FontDescriptor = new PdfFontDescriptor(document, ttDescriptor);
            _fontOptions = font.PdfOptions;
            Debug.Assert(_fontOptions != null);

            _cmapInfo = new CMapInfo(ttDescriptor);
            _descendantFont = new PdfCIDFont(document, FontDescriptor, font);
            _descendantFont.CMapInfo = _cmapInfo;

            // Create ToUnicode map
            _toUnicode = new PdfToUnicodeMap(document, _cmapInfo);
            document.Internals.AddObject(_toUnicode);
            Elements.Add(Keys.ToUnicode, _toUnicode);

            BaseFont = font.GlyphTypeface.GetBaseName();
            // CID fonts are always embedded
            BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont);

            FontDescriptor.FontName = BaseFont;
            _descendantFont.BaseFont = BaseFont;

            PdfArray descendantFonts = new PdfArray(document);
            Owner._irefTable.Add(_descendantFont);
            descendantFonts.Elements.Add(_descendantFont.Reference);
            Elements[Keys.DescendantFonts] = descendantFonts;
        }
开发者ID:Sl0vi,项目名称:PDFsharp,代码行数:33,代码来源:PdfType0Font.cs


示例2: PdfPageTree

 public PdfPageTree(PdfObjectId objectId)
     : base(objectId)
 {
     this[PdfName.Names.Type] = PdfName.Names.Pages;
     this.kids = new PdfArray();
     this[PdfName.Names.Kids] = kids;
 }
开发者ID:nholik,项目名称:Fo.Net,代码行数:7,代码来源:PdfPageTree.cs


示例3: ArrowAnnotation

        /// <summary>
        /// Initializes a new instance of the <see cref="ArrowAnnotation"/> class.
        /// </summary>
        /// <param name="color">The arrow color.</param>
        /// <param name="x1">The x1.</param>
        /// <param name="y1">The y1.</param>
        /// <param name="x2">The x2.</param>
        /// <param name="y2">The y2.</param>
        public ArrowAnnotation(XColor color, float x1, float y1, float x2, float y2)
        {
            Elements.SetName(Keys.Subtype, "/Line");

            var line = new PdfArray();
            line.Elements.Add(new PdfReal(x1));
            line.Elements.Add(new PdfReal(y1));
            line.Elements.Add(new PdfReal(x2));
            line.Elements.Add(new PdfReal(y2));
            Elements["/L"] = line;

            // change line ending
            PdfArray end = new PdfArray();
            end.Elements.Add(new PdfName("/ClosedArrow"));
            end.Elements.Add(new PdfName("/None"));
            Elements["/LE"] = end;

            // change all color properties
            Elements.SetColor("/IC", color);
            Color = color;

            // change line width
            var bsDict = new PdfBorderStyle(3, BorderStyle.Solid);
            Elements[Keys.BS] = bsDict;
        }
开发者ID:soukoku,项目名称:PdfSharp.ProdExtensions,代码行数:33,代码来源:ArrowAnnotation.cs


示例4: Get

   /**
     <summary>Gets the color corresponding to the specified components.</summary>
     <param name="components">Color components to convert.</param>
   */
   public static DeviceNColor Get(
 PdfArray components
 )
   {
       return (components != null
       ? new DeviceNColor(components)
       : null
       );
   }
开发者ID:jujubeast,项目名称:PDFEditor,代码行数:13,代码来源:DeviceNColor.cs


示例5: PdfResources

 static PdfResources()
 {
     DefaultProcedureSets = new PdfArray();
     DefaultProcedureSets.Add(PdfName.Names.PDF);
     DefaultProcedureSets.Add(PdfName.Names.Text);
     DefaultProcedureSets.Add(PdfName.Names.ImageB);
     DefaultProcedureSets.Add(PdfName.Names.ImageC);
     DefaultProcedureSets.Add(PdfName.Names.ImageI);
 }
开发者ID:nholik,项目名称:Fo.Net,代码行数:9,代码来源:PdfResources.cs


示例6: PdfGoToRemote

 static PdfGoToRemote()
 {
     DefaultDestination = new PdfArray();
     DefaultDestination.Add(new PdfNumeric(0));
     DefaultDestination.Add(PdfName.Names.XYZ);
     DefaultDestination.Add(PdfNull.Null);
     DefaultDestination.Add(PdfNull.Null);
     DefaultDestination.Add(PdfNull.Null);
 }
开发者ID:nholik,项目名称:Fo.Net,代码行数:9,代码来源:PdfGoToRemote.cs


示例7: Write

 protected internal override void Write(PdfWriter writer)
 {
     PdfArray dest = new PdfArray();
     dest.Add(pageReference);
     dest.Add(PdfName.Names.XYZ);
     dest.Add(new PdfNumeric(xPosition));
     dest.Add(new PdfNumeric(yPosition));
     dest.Add(PdfNull.Null);
     this[PdfName.Names.D] = dest;
     base.Write(writer);
 }
开发者ID:nholik,项目名称:Fo.Net,代码行数:11,代码来源:PdfGoTo.cs


示例8: Visit

 public virtual PdfObject Visit(
     PdfArray obj,
     object data
     )
 {
     foreach(PdfDirectObject item in obj)
       {
     if(item != null)
     {item.Accept(this, data);}
       }
       return obj;
 }
开发者ID:n9,项目名称:pdfclown,代码行数:12,代码来源:Visitor.cs


示例9: CleverPdfArrayClone

        private PdfObject CleverPdfArrayClone(PdfArray array) {
            PdfArray newArray = new PdfArray();
            for (int i = 0; i < array.Size; i++) {
                PdfObject obj = array[i];
                if (obj is PdfDictionary)
                    newArray.Add(CleverPdfDictionaryClone((PdfDictionary) obj));
                else
                    newArray.Add(obj);
            }

            return newArray;
        }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:12,代码来源:PdfAChecker.cs


示例10: Get

        /**
          <summary>Gets the color corresponding to the specified components.</summary>
          <param name="components">Color components to convert.</param>
         */
        public static DeviceColor Get(
      PdfArray components
      )
        {
            if(components == null)
            return null;

              switch(components.Count)
              {
            case 1:
              return DeviceGrayColor.Get(components);
            case 3:
              return DeviceRGBColor.Get(components);
            case 4:
              return DeviceCMYKColor.Get(components);
            default:
              return null;
              }
        }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:23,代码来源:DeviceColor.cs


示例11: PdfPage

        public PdfPage(
            PdfResources resources,
            PdfContentStream contents,
            int pagewidth,
            int pageheight,
            PdfObjectId objectId)
            : base(objectId)
        {
            this[PdfName.Names.Type] = PdfName.Names.Page;
            this[PdfName.Names.Resources] = resources.GetReference();
            this[PdfName.Names.Contents] = contents.GetReference();

            PdfArray mediaBox = new PdfArray();
            mediaBox.Add(new PdfNumeric(0));
            mediaBox.Add(new PdfNumeric(0));
            mediaBox.Add(new PdfNumeric(pagewidth));
            mediaBox.Add(new PdfNumeric(pageheight));
            this[PdfName.Names.MediaBox] = mediaBox;
        }
开发者ID:nholik,项目名称:Fo.Net,代码行数:19,代码来源:PdfPage.cs


示例12: FreeTextAnnotation

        /// <summary>
        /// Initializes a new instance of the <see cref="FreeTextAnnotation"/> class.
        /// </summary>
        /// <param name="color">The text color.</param>
        /// <param name="font">The font name.</param>
        /// <param name="fontSize">Size of the font.</param>
        public FreeTextAnnotation(XColor color, string font, double fontSize)
        {
            Elements.SetName(Keys.Subtype, "/FreeText");
            
            string daString = string.Format(CultureInfo.InvariantCulture,
                "{0} {1} {2} rg /{3} {4} Tf /BG []",
                color.R / (double)byte.MaxValue,
                color.G / (double)byte.MaxValue,
                color.B / (double)byte.MaxValue,
                font, fontSize);
            Elements["/DA"] = new PdfString(daString);

            // no border
            var border = new PdfArray();
            border.Elements.Add(new PdfInteger(0));
            border.Elements.Add(new PdfInteger(0));
            border.Elements.Add(new PdfInteger(0));
            Elements[Keys.Border] = border;
        }
开发者ID:soukoku,项目名称:PdfSharp.ProdExtensions,代码行数:25,代码来源:FreeTextAnnotation.cs


示例13: SetMatrix

 public void SetMatrix(float a, float b, float c, float d, float e, float f) {
     matrix = new PdfArray();
     matrix.Add(new PdfNumber(a));
     matrix.Add(new PdfNumber(b));
     matrix.Add(new PdfNumber(c));
     matrix.Add(new PdfNumber(d));
     matrix.Add(new PdfNumber(e));
     matrix.Add(new PdfNumber(f));
 }
开发者ID:,项目名称:,代码行数:9,代码来源:


示例14: FieldLock

 /** Creates a FieldLock instance */
 public FieldLock(PdfName action, PdfArray fields) {
     this.action = action;
     this.fields = fields;
 }
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:5,代码来源:SignaturePermissions.cs


示例15: OutputDss

 private void OutputDss(PdfDictionary dss, PdfDictionary vrim, PdfArray ocsps, PdfArray crls, PdfArray certs) {
     writer.AddDeveloperExtension(PdfDeveloperExtension.ESIC_1_7_EXTENSIONLEVEL5);
     PdfDictionary catalog = reader.Catalog;
     stp.MarkUsed(catalog);
     foreach (PdfName vkey in validated.Keys) {
         PdfArray ocsp = new PdfArray();
         PdfArray crl = new PdfArray();
         PdfArray cert = new PdfArray();
         PdfDictionary vri = new PdfDictionary();
         foreach (byte[] b in validated[vkey].crls) {
             PdfStream ps = new PdfStream(b);
             ps.FlateCompress();
             PdfIndirectReference iref = writer.AddToBody(ps, false).IndirectReference;
             crl.Add(iref);
             crls.Add(iref);
         }
         foreach (byte[] b in validated[vkey].ocsps) {
             PdfStream ps = new PdfStream(b);
             ps.FlateCompress();
             PdfIndirectReference iref = writer.AddToBody(ps, false).IndirectReference;
             ocsp.Add(iref);
             ocsps.Add(iref);
         }
         foreach (byte[] b in validated[vkey].certs) {
             PdfStream ps = new PdfStream(b);
             ps.FlateCompress();
             PdfIndirectReference iref = writer.AddToBody(ps, false).IndirectReference;
             cert.Add(iref);
             certs.Add(iref);
         }
         if (ocsp.Size > 0)
             vri.Put(PdfName.OCSP, writer.AddToBody(ocsp, false).IndirectReference);
         if (crl.Size > 0)
             vri.Put(PdfName.CRL, writer.AddToBody(crl, false).IndirectReference);
         if (cert.Size > 0)
             vri.Put(PdfName.CERT, writer.AddToBody(cert, false).IndirectReference);
         vrim.Put(vkey, writer.AddToBody(vri, false).IndirectReference);
     }
     dss.Put(PdfName.VRI, writer.AddToBody(vrim, false).IndirectReference);
     if (ocsps.Size > 0)
         dss.Put(PdfName.OCSPS, writer.AddToBody(ocsps, false).IndirectReference);
     if (crls.Size > 0)
         dss.Put(PdfName.CRLS, writer.AddToBody(crls, false).IndirectReference);
     if (certs.Size > 0)
         dss.Put(PdfName.CERTS, writer.AddToBody(certs, false).IndirectReference);
     catalog.Put(PdfName.DSS, writer.AddToBody(dss, false).IndirectReference);
 }
开发者ID:jagruti23,项目名称:itextsharp,代码行数:47,代码来源:LtvVerification.cs


示例16: UpdateDss

 private void UpdateDss() {
     PdfDictionary catalog = reader.Catalog;
     stp.MarkUsed(catalog);
     PdfDictionary dss = catalog.GetAsDict(PdfName.DSS);
     PdfArray ocsps = dss.GetAsArray(PdfName.OCSPS);
     PdfArray crls = dss.GetAsArray(PdfName.CRLS);
     PdfArray certs = dss.GetAsArray(PdfName.CERTS);
     dss.Remove(PdfName.OCSPS);
     dss.Remove(PdfName.CRLS);
     dss.Remove(PdfName.CERTS);
     PdfDictionary vrim = dss.GetAsDict(PdfName.VRI);
     //delete old validations
     if (vrim != null) {
         foreach (PdfName n in vrim.Keys) {
             if (validated.ContainsKey(n)) {
                 PdfDictionary vri = vrim.GetAsDict(n);
                 if (vri != null) {
                     DeleteOldReferences(ocsps, vri.GetAsArray(PdfName.OCSP));
                     DeleteOldReferences(crls, vri.GetAsArray(PdfName.CRL));
                     DeleteOldReferences(certs, vri.GetAsArray(PdfName.CERT));
                 }
             }
         }
     }
     if (ocsps == null)
         ocsps = new PdfArray();
     if (crls == null)
         crls = new PdfArray();
     if (certs == null)
         certs = new PdfArray();
     OutputDss(dss, vrim, ocsps, crls, certs);
 }
开发者ID:jagruti23,项目名称:itextsharp,代码行数:32,代码来源:LtvVerification.cs


示例17: PdfType0Font

    public PdfType0Font(PdfDocument document, XFont font, bool vertical)
      : base(document)
    {
      Elements.SetName(Keys.Type, "/Font");
      Elements.SetName(Keys.Subtype, "/Type0");
      Elements.SetName(Keys.Encoding, vertical ? "/Identity-V" : "/Identity-H");

      OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorStock.Global.CreateDescriptor(font);
      this.fontDescriptor = new PdfFontDescriptor(document, ttDescriptor);
      this.fontOptions = font.PdfOptions;
      Debug.Assert(this.fontOptions != null);

      this.cmapInfo = new CMapInfo(ttDescriptor);
      this.descendantFont = new PdfCIDFont(document, this.fontDescriptor, font);
      this.descendantFont.CMapInfo = this.cmapInfo;

      // Create ToUnicode map
      this.toUnicode = new PdfToUnicodeMap(document, this.cmapInfo);
      document.Internals.AddObject(toUnicode);
      Elements.Add(Keys.ToUnicode, toUnicode);

      //if (this.fontOptions.BaseFont != "")
      //{
      //  BaseFont = this.fontOptions.BaseFont;
      //}
      //else
      {
        BaseFont = font.Name.Replace(" ", "");
        switch (font.Style & (XFontStyle.Bold | XFontStyle.Italic))
        {
          case XFontStyle.Bold:
            this.BaseFont += ",Bold";
            break;

          case XFontStyle.Italic:
            this.BaseFont += ",Italic";
            break;

          case XFontStyle.Bold | XFontStyle.Italic:
            this.BaseFont += ",BoldItalic";
            break;
        }
      }
      // CID fonts are always embedded
      BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont);

      this.fontDescriptor.FontName = BaseFont;
      this.descendantFont.BaseFont = BaseFont;

      PdfArray descendantFonts = new PdfArray(document);
      Owner.irefTable.Add(descendantFont);
      descendantFonts.Elements.Add(descendantFont.Reference);
      Elements[Keys.DescendantFonts] = descendantFonts;
    }
开发者ID:inexorabletash,项目名称:PDFsharp,代码行数:54,代码来源:PdfType0Font.cs


示例18: Get

   /**
     <summary>Gets the color corresponding to the specified components.</summary>
     <param name="components">Color components to convert.</param>
   */
   public static SeparationColor Get(
 PdfArray components
 )
   {
       return (components != null
       ? new SeparationColor(components)
       : Default
       );
   }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:13,代码来源:SeparationColor.cs


示例19: PdfAnnotations

 internal PdfAnnotations(PdfArray array)
   : base(array)
 {
 }
开发者ID:BackupTheBerlios,项目名称:zp7-svn,代码行数:4,代码来源:PdfAnnotations.cs


示例20: BeforeClone

     /**
     <summary>Notifies a starting clone operation on an array item.</summary>
     <param name="cloner">Object cloner.</param>
     <param name="parent">Parent clone object.</param>
     <param name="index">Item index within the parent.</param>
     <param name="item">Source item.</param>
     <returns>Whether the clone operation can be fulfilled.</returns>
       */
     public virtual bool BeforeClone(
 Cloner cloner,
 PdfArray parent,
 int index,
 PdfDirectObject item
 )
     {
         return true;
     }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:17,代码来源:Cloner.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PdfDictionary类代码示例发布时间:2022-05-24
下一篇:
C# PdfAConformanceLevel类代码示例发布时间: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