Exemple #1
0
        public virtual void testGeneratedObject()
        {
            n = doc.getJDFRoot();
            JDFLayout  lo  = (JDFLayout)n.addResource("Layout", null, EnumUsage.Input, null, null, null, null);
            JDFRunList rlo = (JDFRunList)n.addResource("RunList", null, EnumUsage.Output, null, null, null, null);

            rlo.setFileURL("output.pdf");

            lo.appendXMLComment("This is a simple horizontal slug line\nAnchor specifies which of the 9 coordinates is the 0 point for the coordinate system specified in the CTM\nThis slugline describes error and endtime in the lower left corner of the scb", null);
            JDFMarkObject mark = lo.appendMarkObject();

            mark.setCTM(new JDFMatrix("1 0 0 1 0 0"));
            JDFJobField jf = mark.appendJobField();

            jf.setShowList(new VString("Error EndTime", " "));

            lo.appendXMLComment("This is a simple vertical slug line\nAnchor specifies which of the 9 coordinates is the 0 point for the coordinate system specified in the CTM\nThis slugline describes the operator name along the right side of the sheet text from top to bottom\nthe slug line (top right of the slug cs) is anchored in the bottom right of the sheet.\nNote that the coordinates in the ctm are guess work. the real coordinates are left as an exercise for the reader;-)", null);
            mark = lo.appendMarkObject();
            mark.setCTM(new JDFMatrix("0 1 -1 0 555 444"));
            jf = mark.appendJobField();
            jf.setShowList(new VString("Operator", " "));
            JDFDeviceMark dm = jf.appendDeviceMark();

            dm.setAttribute("Anchor", "TopRight");
            dm.setFont("Arial");
            dm.setFontSize(10);

            lo.appendXMLComment("This is a formatted vertical slug line\nAnchor specifies which of the 9 coordinates is the 0 point for the coordinate system specified in the CTM\nThis slugline describes a formatted line along the left side of the sheet text from top to bottom\nthe slug line (top left) is anchored in the bottom left of the sheet.\nThe text is defined in @Format with the sequence in ShowList defining the 5 placeholders marked by %s or %i\nAn example instance would be: \"This Cyan plate of Sheet1 was proudly produced by Joe Cool! Resolution: 600 x 600\"\nNote that the coordinates in the ctm are guess work. the real coordinates are left as an exercise for the reader;-)", null);
            mark = lo.appendMarkObject();
            mark.setCTM(new JDFMatrix("0 1 -1 0 0 0"));
            jf = mark.appendJobField();
            jf.setShowList(new VString("Separation SheetName Operator ResolutionX ResolutionY", " "));
            jf.setAttribute("Format", "This %s plate of %s was proudly produced by %s!\nResolution: %i x %i");
            dm = jf.appendDeviceMark();
            dm.setAttribute("Anchor", "TopLeft");
            dm.setFont("Arial");
            dm.setFontSize(10);

            lo.appendXMLComment("This is a positioned registermark\nthe center of the mark is translated by 666 999\n the JobField is empty and serves aa a Marker that no external Content is requested", null);
            mark = lo.appendMarkObject();
            mark.setCTM(new JDFMatrix("1 0 0 1 666 999"));
            jf = mark.appendJobField();
            mark.appendXMLComment("The coordinate system origin is defined by the anchor in the center, i.e. 0 0\n the separartions are excluding black", null);
            JDFRegisterMark rm = mark.appendRegisterMark();

            rm.setMarkType("Arc Cross");
            rm.setMarkUsage(EnumMarkUsage.Color);
            rm.setCenter(new JDFXYPair("0 0"));
            rm.setSeparations(new VString("Cyan Magent Yellow", " "));
            dm = jf.appendDeviceMark();
            dm.setAttribute("Anchor", "Center");

            doc.write2File(sm_dirTestDataTemp + "generatedObject.jdf", 2, false);
        }
Exemple #2
0
        public virtual void testAutoRegister()
        {
            Assert.AreEqual(EnumVersion.Version_1_3, n.getVersion(false), "version ok");
            JDFLayout            lo      = (JDFLayout)n.appendMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null);
            JDFColorControlStrip autoReg = lo.appendMarkObject().appendColorControlStrip();

            autoReg.setStripType("AutoRegister");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Black");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Cyan");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Yellow");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Magenta");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Spot1");
            autoReg.appendElement("SeparationSpec").setAttribute("Name", "Spot2");
            JDFColorControlStrip fms = lo.getMarkObject(0).appendColorControlStrip();

            fms.setStripType("FMS");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Black");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Yellow");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Magenta");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Cyan");

            fms = lo.getMarkObject(0).appendColorControlStrip();
            fms.setStripType("FMS");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Spot1");
            fms.appendElement("SeparationSpec").setAttribute("Name", "Spot2");
            doc.write2File(sm_dirTestDataTemp + "autoregister.jdf", 2, false);
        }
Exemple #3
0
        public virtual void testWebGrowthCompensation()
        {
            JDFElement.setLongID(false);
            doc = new JDFDoc("JDF");
            JDFNode         n    = doc.getJDFRoot();
            JDFResourcePool rp   = n.getCreateResourcePool();
            JDFResource     lo   = n.addResource("Layout", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);
            JDFLayout       losh = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Sheet1");
            JDFLayout       lofr = (JDFLayout)losh.addPartition(EnumPartIDKey.Side, EnumSide.Front.getName());

            rp.appendXMLComment("LayoutShift SHOULD be partitioned: at least Side and Separation will make sense", null);

            JDFResource los = n.addResource("LayoutShift", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);

            los.appendXMLComment("Note that the interpolation algorithm between positions is implementation dependent", null);
            los = los.addPartition(EnumPartIDKey.Side, "Front");
            VString vSep = new VString("Cyan Magenta Yellow Black", " ");

            for (int i = 0; i < 16; i++)
            {
                int x               = 720 * (i % 4);
                int y               = 1000 * (i / 4);
                int ord             = i % 8;
                JDFContentObject co = lofr.appendContentObject();
                co.setOrd(ord);
                co.setOrdID(i);
                co.setCTM(new JDFMatrix(1, 0, 0, 1, x, y));
                JDFMarkObject mo = lofr.appendMarkObject();
                mo.setOrd(ord);
                mo.setOrdID(i + 100);
                mo.setCTM(new JDFMatrix(1, 0, 0, 1, x + 700, y + 900));
            }
            for (int j = 0; j < vSep.Count; j++)
            {
                KElement sepShift = los.addPartition(EnumPartIDKey.Separation, vSep.stringAt(j));
                for (int i = 0; i < 16; i += 2)
                {
                    int      x           = 720 * (i % 4);
                    int      y           = 1000 * (i / 4);
                    KElement shiftObject = sepShift.appendElement("ShiftPoint");

                    shiftObject.setAttribute("Position", new JDFXYPair(x + 360, y + 500).ToString());
                    shiftObject.setAttribute("CTM", new JDFMatrix(1, 0, 0, 1, j + i / 4, j + i % 4).ToString());
                }
            }
            doc.write2File(sm_dirTestDataTemp + "WebgrowthPartition.jdf", 2, false);
        }
Exemple #4
0
        public virtual void testElementVersion()
        {
            VString vPrerelease = null;
            VString vOptional   = null;
            VString vDeprecated = null;

            JDFDoc  jdfDoc = new JDFDoc("JDF");
            JDFNode root   = jdfDoc.getJDFRoot();

            // check AdhesiveBindingParams/GlueApplication
            //
            root.setVersion(JDFElement.EnumVersion.Version_1_3);
            JDFAdhesiveBindingParams adhesiveBindingParam = (JDFAdhesiveBindingParams)root.addResource(ElementName.ADHESIVEBINDINGPARAMS, null, EnumUsage.Input, null, null, null, null);

            vDeprecated = adhesiveBindingParam.getTheElementInfo().deprecatedElements();
            adhesiveBindingParam.appendGlueApplication();
            vDeprecated = adhesiveBindingParam.getDeprecatedElements(99999999);
            Assert.IsTrue(vDeprecated.Contains(ElementName.GLUEAPPLICATION));

            root.setVersion(JDFElement.EnumVersion.Version_1_0);
            vDeprecated = adhesiveBindingParam.getDeprecatedElements(99999999);
            Assert.AreEqual(0, vDeprecated.Count);

            // check MarkObject/DeviceMark
            //
            root.setVersion(JDFElement.EnumVersion.Version_1_0);
            JDFLayout     layout     = (JDFLayout)root.addResource(ElementName.LAYOUT, null, EnumUsage.Input, null, null, null, null);
            JDFMarkObject markObject = layout.appendMarkObject();

            markObject.appendDeviceMark();
            vPrerelease = markObject.getPrereleaseElements(99999999);
            Assert.IsTrue(vPrerelease.Contains(ElementName.DEVICEMARK));

            root.setVersion(JDFElement.EnumVersion.Version_1_1);
            vOptional = markObject.getTheElementInfo().optionalElements();
            Assert.IsTrue(vOptional.Contains(ElementName.DEVICEMARK));

            root.setVersion(JDFElement.EnumVersion.Version_1_2);
            vOptional = markObject.getTheElementInfo().optionalElements();
            Assert.IsTrue(vOptional.Contains(ElementName.DEVICEMARK));

            root.setVersion(JDFElement.EnumVersion.Version_1_3);
            vDeprecated = markObject.getTheElementInfo().deprecatedElements();
            Assert.IsTrue(vDeprecated.Contains(ElementName.DEVICEMARK));
        }