本文整理汇总了C#中PdfName.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# PdfName.Equals方法的具体用法?C# PdfName.Equals怎么用?C# PdfName.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfName
的用法示例。
在下文中一共展示了PdfName.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get
/**
<summary>Gets a specific filter object.</summary>
<param name="name">Name of the requested filter.</param>
<returns>Filter object associated to the name.</returns>
*/
public static Filter Get(
PdfName name
)
{
/*
NOTE: This is a factory singleton method for any filter-derived object.
*/
if(name == null)
return null;
if(name.Equals(PdfName.FlateDecode)
|| name.Equals(PdfName.Fl))
return FlateDecode;
else if(name.Equals(PdfName.LZWDecode)
|| name.Equals(PdfName.LZW))
throw new NotImplementedException("LZWDecode");
else if(name.Equals(PdfName.ASCIIHexDecode)
|| name.Equals(PdfName.AHx))
throw new NotImplementedException("ASCIIHexDecode");
else if(name.Equals(PdfName.ASCII85Decode)
|| name.Equals(PdfName.A85))
return ASCII85Filter;
else if(name.Equals(PdfName.RunLengthDecode)
|| name.Equals(PdfName.RL))
throw new NotImplementedException("RunLengthDecode");
else if(name.Equals(PdfName.CCITTFaxDecode)
|| name.Equals(PdfName.CCF))
throw new NotImplementedException("CCITTFaxDecode");
else if(name.Equals(PdfName.JBIG2Decode))
throw new NotImplementedException("JBIG2Decode");
else if(name.Equals(PdfName.DCTDecode)
|| name.Equals(PdfName.DCT))
throw new NotImplementedException("DCTDecode");
else if(name.Equals(PdfName.JPXDecode))
throw new NotImplementedException("JPXDecode");
else if(name.Equals(PdfName.Crypt))
throw new NotImplementedException("Crypt");
return null;
}
示例2: GetComponentsPerPixel
/**
* @param colorSpaceName the name of the color space. If null, a bi-tonal (black and white) color space is assumed.
* @return the components per pixel for the specified color space
*/
private static int GetComponentsPerPixel(PdfName colorSpaceName, PdfDictionary colorSpaceDic){
if (colorSpaceName == null)
return 1;
if (colorSpaceName.Equals(PdfName.DEVICEGRAY))
return 1;
if (colorSpaceName.Equals(PdfName.DEVICERGB))
return 3;
if (colorSpaceName.Equals(PdfName.DEVICECMYK))
return 4;
if (colorSpaceDic != null){
PdfArray colorSpace = colorSpaceDic.GetAsArray(colorSpaceName);
if (colorSpace != null){
if (PdfName.INDEXED.Equals(colorSpace.GetAsName(0))){
return 1;
}
}
}
throw new ArgumentException("Unexpected color space " + colorSpaceName);
}
示例3: GetAlternateValue
/**
* Transforms value abbreviations into their corresponding real value
* @param key the key that the value is for
* @param value the value that might be an abbreviation
* @return if value is an allowed abbreviation for the key, the expanded value for that abbreviation. Otherwise, value is returned without modification
*/
private static PdfObject GetAlternateValue(PdfName key, PdfObject value){
if (key.Equals(PdfName.FILTER)){
if (value is PdfName){
PdfName altValue;
inlineImageFilterAbbreviationMap.TryGetValue((PdfName)value, out altValue);
if (altValue != null)
return altValue;
} else if (value is PdfArray){
PdfArray array = ((PdfArray)value);
PdfArray altArray = new PdfArray();
int count = array.Size;
for (int i = 0; i < count; i++){
altArray.Add(GetAlternateValue(key, array[i]));
}
return altArray;
}
} else if (key.Equals(PdfName.COLORSPACE)){
if (value is PdfName){
PdfName altValue;
inlineImageColorSpaceAbbreviationMap.TryGetValue((PdfName)value, out altValue);
if (altValue != null)
return altValue;
}
}
return value;
}