Esempio n. 1
0
        public void testActualColorName()
        {
            colParams.setXMLComment("Note that all Strings in ColorantParams etc. use Color/@Name, NOT Color/@ActualColorName");
            colParams.setSeparations(new VString("Spot1,BlackText", ","));
            colControl.setXMLComment("Simple colorantcontrol from MIS: CMYK + 1 spot+ 1 black text version; knows no more");
            d.write2File(sm_dirTestDataTemp + "ActualColorName_MIS.jdf", 2, false);

            colControl.setXMLComment("ColorantControl after prepress has correctly set ActualColorName based on pdl content");
            JDFColor co = colPool.appendColorWithName("Black", null);

            co.setXMLComment("Color that maps the predefined separation Black\n" + "ActualColorName is the new attribute that replaces ExposedMedia/@DescriptiveName as the \"Main\" PDL color");
            co.setCMYK(new JDFCMYKColor(0, 0, 0, 1));
            Assert.IsTrue(co.isValid(EnumValidationLevel.Incomplete));
            co.setAttribute("ActualColorName", "Schwarz");

            co = colPool.appendColorWithName("Yellow", null);
            co.setAttribute("ActualColorName", "Gelb");
            co.setCMYK(new JDFCMYKColor(0, 0, 1, 0));

            co = colPool.appendColorWithName("Cyan", null);
            co.setXMLComment("ActualColorName defaults to Name if not specified");
            co.setCMYK(new JDFCMYKColor(1, 0, 0, 0));

            co = colPool.appendColorWithName("Magenta", null);
            co = colPool.appendColorWithName("Spot1", null);
            co.setAttribute("ActualColorName", "Acme Aqua");
            co.setCMYK(new JDFCMYKColor(0.7, 0.2, 0.03, 0.1));

            co = colPool.appendColorWithName("BlackText", null);
            co.setAttribute("ActualColorName", "VersionsText");
            co.setCMYK(new JDFCMYKColor(0, 0, 0, 1));

            d.write2File(sm_dirTestDataTemp + "ActualColorName_Prepress.jdf", 2, false);

            JDFColorantAlias ca = colControl.appendColorantAlias();

            ca.setXMLComment("ColorantAlias that maps the additional representation (noir) to the predefined separation Black");
            ca.setReplacementColorantName("Black");
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Incomplete));
            Assert.IsFalse(ca.isValid(EnumValidationLevel.Complete));
            VString vAlias = new VString("noir schwärz", null);

            ca.setSeparations(vAlias);
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Complete));
            byte[] b        = Encoding.Default.GetBytes(vAlias.stringAt(0));
            string rawNames = StringUtil.setHexBinaryBytes(b, -1) + " ";

            b         = Encoding.Default.GetBytes(vAlias.stringAt(1));
            rawNames += StringUtil.setHexBinaryBytes(b, -1);
            ca.setAttribute("RawNames", rawNames);
            d.write2File(sm_dirTestDataTemp + "ActualColorName_with_CA.jdf", 2, false);
        }
Esempio n. 2
0
        public void testColorantAlias()
        {
            JDFColorantAlias ca = colControl.appendColorantAlias();

            ca.setXMLComment("ColorantAlias that maps the predefined separation Black");
            ca.setReplacementColorantName("Green");
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Incomplete));
            Assert.IsFalse(ca.isValid(EnumValidationLevel.Complete));
            VString vAlias = new VString("Grün grün", null);

            ca.setSeparations(vAlias);
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Complete));
            byte[] b        = Encoding.Default.GetBytes(vAlias.stringAt(0));
            string rawNames = StringUtil.setHexBinaryBytes(b, -1) + " ";

            b         = Encoding.Default.GetBytes(vAlias.stringAt(1));
            rawNames += StringUtil.setHexBinaryBytes(b, -1);
            Assert.IsTrue(ca.isValid(EnumValidationLevel.Complete));
            ca.setAttribute("RawNames", rawNames);

            d.write2File(sm_dirTestDataTemp + "ColorantAlias.jdf", 2, false);
        }