本文整理匯總了C#中iTextSharp.text.pdf.PdfString.SetObjNum方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfString.SetObjNum方法的具體用法?C# PdfString.SetObjNum怎麽用?C# PdfString.SetObjNum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfString
的用法示例。
在下文中一共展示了PdfString.SetObjNum方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ReadPRObject
virtual protected internal PdfObject ReadPRObject() {
tokens.NextValidToken();
PRTokeniser.TokType type = tokens.TokenType;
switch (type) {
case PRTokeniser.TokType.START_DIC: {
++readDepth;
PdfDictionary dic = ReadDictionary();
--readDepth;
long pos = tokens.FilePointer;
// be careful in the trailer. May not be a "next" token.
bool hasNext;
do {
hasNext = tokens.NextToken();
} while (hasNext && tokens.TokenType == PRTokeniser.TokType.COMMENT);
if (hasNext && tokens.StringValue.Equals("stream")) {
//skip whitespaces
int ch;
do {
ch = tokens.Read();
} while (ch == 32 || ch == 9 || ch == 0 || ch == 12);
if (ch != '\n')
ch = tokens.Read();
if (ch != '\n')
tokens.BackOnePosition(ch);
PRStream stream = new PRStream(this, tokens.FilePointer);
stream.Merge(dic);
stream.ObjNum = objNum;
stream.ObjGen = objGen;
return stream;
}
else {
tokens.Seek(pos);
return dic;
}
}
case PRTokeniser.TokType.START_ARRAY: {
++readDepth;
PdfArray arr = ReadArray();
--readDepth;
return arr;
}
case PRTokeniser.TokType.NUMBER:
return new PdfNumber(tokens.StringValue);
case PRTokeniser.TokType.STRING:
PdfString str = new PdfString(tokens.StringValue, null).SetHexWriting(tokens.IsHexString());
str.SetObjNum(objNum, objGen);
if (strings != null)
strings.Add(str);
return str;
case PRTokeniser.TokType.NAME: {
PdfName cachedName;
PdfName.staticNames.TryGetValue(tokens.StringValue, out cachedName);
if (readDepth > 0 && cachedName != null) {
return cachedName;
} else {
// an indirect name (how odd...), or a non-standard one
return new PdfName(tokens.StringValue, false);
}
}
case PRTokeniser.TokType.REF:
int num = tokens.Reference;
PRIndirectReference refi = new PRIndirectReference(this, num, tokens.Generation);
return refi;
case PRTokeniser.TokType.ENDOFFILE:
throw new IOException(MessageLocalization.GetComposedMessage("unexpected.end.of.file"));
default:
String sv = tokens.StringValue;
if ("null".Equals(sv)) {
if (readDepth == 0) {
return new PdfNull();
} //else
return PdfNull.PDFNULL;
}
else if ("true".Equals(sv)) {
if (readDepth == 0) {
return new PdfBoolean( true );
} //else
return PdfBoolean.PDFTRUE;
}
else if ("false".Equals(sv)) {
if (readDepth == 0) {
return new PdfBoolean( false );
} //else
return PdfBoolean.PDFFALSE;
}
return new PdfLiteral(-(int)type, tokens.StringValue);
}
}