本文整理匯總了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;
}
示例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));
}
}
示例3: DecodeString
private String DecodeString(PdfString ps) {
if (ps.IsHexWriting())
return PdfEncodings.ConvertToString(ps.GetBytes(), "UnicodeBigUnmarked");
else
return ps.ToUnicodeString();
}
示例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);
}
示例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;
}