本文整理匯總了C#中iTextSharp.text.pdf.parser.PdfContentStreamProcessor.GetFont方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfContentStreamProcessor.GetFont方法的具體用法?C# PdfContentStreamProcessor.GetFont怎麽用?C# PdfContentStreamProcessor.GetFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.parser.PdfContentStreamProcessor
的用法示例。
在下文中一共展示了PdfContentStreamProcessor.GetFont方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Invoke
public void Invoke(PdfContentStreamProcessor processor, PdfLiteral oper, List<PdfObject> operands) {
PdfName dictionaryName = (PdfName)operands[0];
PdfDictionary extGState = processor.resources.GetAsDict(PdfName.EXTGSTATE);
if (extGState == null)
throw new ArgumentException(MessageLocalization.GetComposedMessage("resources.do.not.contain.extgstate.entry.unable.to.process.oper.1", oper));
PdfDictionary gsDic = extGState.GetAsDict(dictionaryName);
if (gsDic == null)
throw new ArgumentException(MessageLocalization.GetComposedMessage("1.is.an.unknown.graphics.state.dictionary", dictionaryName));
// at this point, all we care about is the FONT entry in the GS dictionary
PdfArray fontParameter = gsDic.GetAsArray(PdfName.FONT);
if (fontParameter != null){
CMapAwareDocumentFont font = processor.GetFont((PRIndirectReference)fontParameter[0]);
float size = fontParameter.GetAsNumber(1).FloatValue;
processor.Gs().font = font;
processor.Gs().fontSize = size;
}
}