當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfString.GetBytes方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfString.GetBytes方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfString.GetBytes方法的具體用法?C# PdfString.GetBytes怎麽用?C# PdfString.GetBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.PdfString的用法示例。


在下文中一共展示了PdfString.GetBytes方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ParseDAParam

        IDictionary<string, IList<object>> ParseDAParam(PdfString DA) {
            IDictionary<string, IList<object>> commandArguments = new Dictionary<string, IList<object>>();

            PRTokeniser tokeniser = new PRTokeniser(new RandomAccessFileOrArray(new RandomAccessSourceFactory().CreateSource(DA.GetBytes())));
            IList<object> currentArguments = new List<object>();

            while (tokeniser.NextToken()) {
                if (tokeniser.TokenType == PRTokeniser.TokType.OTHER) {
                    String key = tokeniser.StringValue;

                    if (key == "RG" || key == "G" || key == "K") {
                        key = STROKE_COLOR;
                    } else if (key == "rg" || key == "g" || key == "k") {
                        key = FILL_COLOR;
                    }

                    if (commandArguments.ContainsKey(key)) {
                        commandArguments[key] = currentArguments;
                    } else {
                        commandArguments.Add(key, currentArguments);
                    }

                    currentArguments = new List<object>();
                } else {
                    switch (tokeniser.TokenType) {
                        case PRTokeniser.TokType.NUMBER:
                            currentArguments.Add(new PdfNumber(tokeniser.StringValue));
                            break;

                        case PRTokeniser.TokType.NAME:
                            currentArguments.Add(new PdfName(tokeniser.StringValue));
                            break;

                        default:
                            currentArguments.Add(tokeniser.StringValue);
                            break;
                    }
                }
            }

            return commandArguments;
        }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:42,代碼來源:PdfCleanUpProcessor.cs

示例2: AddChar

 internal override void AddChar(PdfString mark, PdfObject code)
 {
     byte[] src = mark.GetBytes();
     String dest = CreateStringFromBytes(code.GetBytes());
     if (src.Length == 1) {
         singleByteMappings[src[0] & 0xff] = dest;
     } else if (src.Length == 2) {
         int intSrc = src[0] & 0xFF;
         intSrc <<= 8;
         intSrc |= src[1] & 0xFF;
         doubleByteMappings[intSrc] = dest;
     } else {
         throw new IOException(MessageLocalization.GetComposedMessage("mapping.code.should.be.1.or.two.bytes.and.not.1", src.Length));
     }
 }
開發者ID:jomamorales,項目名稱:createPDF,代碼行數:15,代碼來源:CMapToUnicode.cs

示例3: DecodeString

 private String DecodeString(PdfString ps) {
     if (ps.IsHexWriting())
         return PdfEncodings.ConvertToString(ps.GetBytes(), "UnicodeBigUnmarked");
     else
         return ps.ToUnicodeString();
 }
開發者ID:,項目名稱:,代碼行數:6,代碼來源:

示例4: Decode

 /**
  * Decodes a PdfString (which will contain glyph ids encoded in the font's encoding)
  * based on the active font, and determine the unicode equivalent
  * @param in    the String that needs to be encoded
  * @return  the encoded String
  * @since 2.1.7
  */
 private String Decode(PdfString inp){
     byte[] bytes = inp.GetBytes();
     return Gs().font.Decode(bytes, 0, bytes.Length);
 }
開發者ID:,項目名稱:,代碼行數:11,代碼來源:

示例5: DecodeStringToByte

 public static byte[] DecodeStringToByte(PdfString s) {
     byte[] b = s.GetBytes();
     byte[] br = new byte[b.Length];
     System.Array.Copy(b, 0, br, 0, b.Length);
     return br;
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:6,代碼來源:AbstractCMap.cs


注:本文中的iTextSharp.text.pdf.PdfString.GetBytes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。