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); }
public virtual void testCombinedVarnish() { JDFElement.setLongID(false); JDFDoc d = new JDFDoc("JDF"); JDFNode n = d.getJDFRoot(); VString vCombiNodes = new VString("ConventionalPrinting Varnishing", " "); VString vSeparations = new VString("Cyan Magenta Yellow Black Varnish", " "); n.setCombined(vCombiNodes); JDFConventionalPrintingParams cpp = (JDFConventionalPrintingParams)n.addResource(ElementName.CONVENTIONALPRINTINGPARAMS, null, EnumUsage.Input, null, null, null, null); cpp.setModuleAvailableIndex(new JDFIntegerRangeList("1 ~ 6")); cpp.setModuleIndex(new JDFIntegerRangeList("1 ~ 4 6")); cpp.appendXMLComment("Module 0 and 7 are varnishing modules, 1-4 are process colors and 6 is the ink module used to varnish", null); n.appendMatchingResource("Component", JDFNode.EnumProcessUsage.AnyOutput, null); JDFExposedMedia xm = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", JDFNode.EnumProcessUsage.Plate, null); n.appendNodeInfo(); JDFMedia media = xm.appendMedia(); media.setMediaType(EnumMediaType.Plate); JDFInk ink = (JDFInk)n.appendMatchingResource("Ink", JDFNode.EnumProcessUsage.AnyInput, null); JDFResource vp = n.addResource("VarnishingParams", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null); JDFExposedMedia xmVarnish = (JDFExposedMedia)n.addResource("ExposedMedia", null, EnumUsage.Input, null, null, null, null); JDFMedia mediaVarnish = xmVarnish.appendMedia(); mediaVarnish.setAttribute("MediaType", "Sleeve"); JDFResourceLink rl = n.getLink(xmVarnish, null); JDFColorantControl cc = (JDFColorantControl)n.appendMatchingResource(ElementName.COLORANTCONTROL, JDFNode.EnumProcessUsage.AnyInput, null); cc.getCreateDeviceColorantOrder().appendXMLComment("Should the VarnishingParams seps be excluded, as is shown here?", null); cc.getCreateDeviceColorantOrder().setSeparations(vSeparations); rl.setCombinedProcessIndex(new JDFIntegerList("1")); vSeparations.addAll(new VString("PreVarnish Varnish2", " ")); for (int i = 0; i < vSeparations.Count; i++) { string sep = vSeparations.stringAt(i); ink.addPartition(EnumPartIDKey.Separation, sep); if (!sep.Equals("PreVarnish") && !sep.Equals("Varnish2")) { xm.addPartition(EnumPartIDKey.Separation, sep); } if (sep.Equals("Varnish2")) { vp.appendXMLComment("full varnishing in a varnishing module with or wihtout a sleeve. Full varnishing means to cover the complete media surface.", null); xmVarnish.addPartition(EnumPartIDKey.Separation, sep); JDFResource varnishPart = vp.addPartition(EnumPartIDKey.Separation, sep); varnishPart.setAttribute("ModuleIndex", "7"); varnishPart.setAttribute("VarnishMethod", "Sleeve"); varnishPart.setAttribute("VarnishArea", "Spot"); } else if (sep.Equals("Varnish")) { vp.appendXMLComment("varnishing in a printing module only with a mandatory plate. The plate may be exposed or not, for example, for full varnihing. ", null); // xmVarnish.addPartition(EnumPartIDKey.Separation, sep); JDFResource varnishPart = vp.addPartition(EnumPartIDKey.Separation, sep); varnishPart.setAttribute("ModuleIndex", "6"); varnishPart.setAttribute("VarnishMethod", "Plate"); varnishPart.setAttribute("VarnishArea", "Full"); } else if (sep.Equals("PreVarnish")) { vp.appendXMLComment("varnishing in a varnishing module only with a mandatory prepared sleeve ", null); xmVarnish.addPartition(EnumPartIDKey.Separation, sep); JDFResource varnishPart = vp.addPartition(EnumPartIDKey.Separation, sep); varnishPart.setAttribute("ModuleIndex", "0"); varnishPart.setAttribute("VarnishMethod", "Sleeve"); varnishPart.setAttribute("VarnishArea", "Full"); } } d.write2File(sm_dirTestDataTemp + "varnishing.jdf", 2, true); }