public virtual void DeviceNColorspaceNoAttributesDictionary() { NUnit.Framework.Assert.That(() => { //TODO DEVSIX-4203 should not cause an IndexOutOfBoundException. // Should throw PdfAConformanceException as Colorants dictionary always must be present // for Pdf/A-2 int numberOfComponents = 2; IList <String> tmpArray = new List <String>(numberOfComponents); float[] transformArray = new float[numberOfComponents * 2]; for (int i = 0; i < numberOfComponents; i++) { tmpArray.Add("MyColor" + i + 1); transformArray[i * 2] = 0; transformArray[i * 2 + 1] = 1; } PdfFunction.Type4 function = new PdfFunction.Type4(new PdfArray(transformArray), new PdfArray(new float[] { 0, 1, 0, 1, 0, 1 }), "{0}".GetBytes(iText.IO.Util.EncodingUtil.ISO_8859_1)); PdfDictionary currentColorSpaces = new PdfDictionary(); pdfA2Checker.CheckColorSpace(new PdfSpecialCs.DeviceN(tmpArray, new PdfDeviceCs.Rgb(), function), currentColorSpaces , true, false); } , NUnit.Framework.Throws.InstanceOf <Exception>()) ; }
private void CheckColorspace(PdfColorSpace colorSpace) { PdfDictionary currentColorSpaces = new PdfDictionary(); pdfA2Checker.CheckColorSpace(colorSpace, currentColorSpaces, true, false); }