Пример #1
0
        protected override void CheckImage(PdfWriter writer, int key, Object obj1)
        {
            PdfImage image = (PdfImage)obj1;

            if (image.Get(PdfName.SMASK) != null && !PdfName.NONE.Equals(image.GetAsName(PdfName.SMASK)))
            {
                throw new PdfAConformanceException(obj1, MessageLocalization.GetComposedMessage("the.smask.key.is.not.allowed.in.images"));
            }
            if (image.Contains(PdfName.ALTERNATES))
            {
                throw new PdfAConformanceException(obj1, MessageLocalization.GetComposedMessage("an.image.dictionary.shall.not.contain.alternates.key"));
            }
            if (image.Contains(PdfName.OPI))
            {
                throw new PdfAConformanceException(obj1, MessageLocalization.GetComposedMessage("an.image.dictionary.shall.not.contain.opi.key"));
            }
            PdfBoolean interpolate = image.GetAsBoolean(PdfName.INTERPOLATE);

            if (interpolate != null && interpolate.BooleanValue)
            {
                throw new PdfAConformanceException(obj1, MessageLocalization.GetComposedMessage("the.value.of.interpolate.key.shall.not.be.true"));
            }
            PdfName intent = image.GetAsName(PdfName.INTENT);

            if (intent != null && !(PdfName.RELATIVECOLORIMETRIC.Equals(intent) || PdfName.ABSOLUTECOLORIMETRIC.Equals(intent) || PdfName.PERCEPTUAL.Equals(intent) || PdfName.SATURATION.Equals(intent)))
            {
                throw new PdfAConformanceException(obj1, MessageLocalization.GetComposedMessage("1.value.of.intent.key.is.not.allowed", intent.ToString()));
            }
        }