本文整理汇总了C#中PdfDictionary.Get方法的典型用法代码示例。如果您正苦于以下问题:C# PdfDictionary.Get方法的具体用法?C# PdfDictionary.Get怎么用?C# PdfDictionary.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfDictionary
的用法示例。
在下文中一共展示了PdfDictionary.Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckEmbeddedFile
protected override void CheckEmbeddedFile(PdfDictionary embeddedFile)
{
PdfObject _params = GetDirectObject(embeddedFile.Get(PdfName.PARAMS));
if (_params == null) {
throw new PdfAConformanceException(embeddedFile,
MessageLocalization.GetComposedMessage("embedded.file.shall.contain.valid.params.key"));
} else if (_params.IsDictionary()) {
PdfObject modDate = ((PdfDictionary) _params).Get(PdfName.MODDATE);
if (modDate == null || !(modDate is PdfString)) {
throw new PdfAConformanceException(embeddedFile,
MessageLocalization.GetComposedMessage("embedded.file.shall.contain.params.key.with.valid.moddate.key"));
}
}
}
示例2: CleverPdfDictionaryClone
private PdfObject CleverPdfDictionaryClone(PdfDictionary dict) {
PdfDictionary newDict;
if (dict.IsStream()) {
newDict = new PdfStream(emptyByteArray);
newDict.Remove(PdfName.LENGTH);
}
else
newDict = new PdfDictionary();
foreach (PdfName key in dict.Keys)
if (keysForCheck.Contains(key))
newDict.Put(key, dict.Get(key));
return newDict;
}
示例3: InspectChildDictionary
/**
* If the child of a structured element is a dictionary, we inspect the
* child; we may also draw a tag.
*
* @param k
* the child dictionary to inspect
*/
virtual public void InspectChildDictionary(PdfDictionary k, bool inspectAttributes) {
if (k == null)
return;
PdfName s = k.GetAsName(PdfName.S);
if (s != null) {
String tagN = PdfName.DecodeName(s.ToString());
String tag = FixTagName(tagN);
outp.Write("<");
outp.Write(tag);
if (inspectAttributes) {
PdfDictionary a = k.GetAsDict(PdfName.A);
if (a != null) {
Dictionary<PdfName, PdfObject>.KeyCollection keys = a.Keys;
foreach (PdfName key in keys) {
outp.Write(' ');
PdfObject value = a.Get(key);
value = PdfReader.GetPdfObject(value);
outp.Write(XmlName(key));
outp.Write("=\"");
outp.Write(value.ToString());
outp.Write("\"");
}
}
}
outp.Write(">");
PdfObject alt = k.Get(PdfName.ALT);
if (alt != null && alt.ToString() != null) {
outp.Write("<alt><![CDATA[");
outp.Write(Regex.Replace(alt.ToString(), "[\\000]*", ""));
outp.Write("]]></alt>");
}
PdfDictionary dict = k.GetAsDict(PdfName.PG);
if (dict != null)
ParseTag(tagN, k.GetDirectObject(PdfName.K), dict);
InspectChild(k.GetDirectObject(PdfName.K));
outp.Write("</");
outp.Write(tag);
outp.WriteLine(">");
} else
InspectChild(k.GetDirectObject(PdfName.K));
}