本文整理匯總了C#中iTextSharp.text.pdf.PdfWriter.IsPdfIso方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfWriter.IsPdfIso方法的具體用法?C# PdfWriter.IsPdfIso怎麽用?C# PdfWriter.IsPdfIso使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfWriter
的用法示例。
在下文中一共展示了PdfWriter.IsPdfIso方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CheckPdfAConformance
/**
*
* @param writer
* @param key
* @param obj1
*/
static public void CheckPdfAConformance(PdfWriter writer, int key, Object obj1) {
if (writer == null || !writer.IsPdfIso())
return;
switch (key) {
case PdfIsoKeys.PDFISOKEY_FONT:
if (!((BaseFont)obj1).IsEmbedded())
throw new PdfAConformanceException(MessageLocalization.GetComposedMessage("all.the.fonts.must.be.embedded.this.one.isn.t.1", ((BaseFont) obj1).PostscriptFontName));
break;
case PdfIsoKeys.PDFISOKEY_IMAGE:
PdfImage image = (PdfImage)obj1;
if (image.Get(PdfName.SMASK) != null)
throw new PdfAConformanceException(MessageLocalization.GetComposedMessage("the.smask.key.is.not.allowed.in.images"));
break;
case PdfIsoKeys.PDFISOKEY_GSTATE:
PdfDictionary gs = (PdfDictionary)obj1;
PdfObject obj = gs.Get(PdfName.BM);
if (obj != null && !PdfGState.BM_NORMAL.Equals(obj) && !PdfGState.BM_COMPATIBLE.Equals(obj))
throw new PdfAConformanceException(MessageLocalization.GetComposedMessage("blend.mode.1.not.allowed", obj.ToString()));
obj = gs.Get(PdfName.CA);
double v = 0.0;
if (obj != null && (v = ((PdfNumber)obj).DoubleValue) != 1.0)
throw new PdfAConformanceException(MessageLocalization.GetComposedMessage("transparency.is.not.allowed.ca.eq.1", v));
obj = gs.Get(PdfName.ca_);
v = 0.0;
if (obj != null && (v = ((PdfNumber)obj).DoubleValue) != 1.0)
throw new PdfAConformanceException(MessageLocalization.GetComposedMessage("transparency.is.not.allowed.ca.eq.1", v));
break;
case PdfIsoKeys.PDFISOKEY_LAYER:
throw new PdfAConformanceException(MessageLocalization.GetComposedMessage("layers.are.not.allowed"));
default:
break;
}
}