/// /// * <param name="xm"> /// * @return </param> /// protected internal virtual JDFMedia initPlateMedia() { if (theParentNode != null) { theNode.ensureLink(theParentNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0), EnumUsage.Input, null); } JDFMedia m = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, EnumUsage.Input, 0); if (EnumMediaType.Paper.Equals(m.getMediaType())) { m = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, EnumUsage.Input, 1); } m.setResStatus(EnumResStatus.Available, false); m.makeRootResource(null, theNode.getJDFRoot(), true); theNode.getJDFRoot().getCreateResourcePool().moveElement(m, null); m.setDescriptiveName("the plates to use"); m.setMediaType(EnumMediaType.Plate); m.setPartUsage(EnumPartUsage.Implicit); if (bPartitionedPlateMedia && vParts != null) { VJDFAttributeMap vSheets = getReducedMap(new VString("Side Separation PartVersion", null)); for (int i = 0; i < vSheets.Count; i++) { JDFAttributeMap part = new JDFAttributeMap(vSheets[i]); // JDFResource mm= m.getCreatePartition(part, partIDKeys); } } else { m.setDimensionCM(new JDFXYPair(70, 102)); } return(m); }
/// /// * <param name="icsLevel"> </param> /// protected internal virtual JDFMedia initPaperMedia() { JDFResourceLink rlM = null; if (thePreviousNode != null) { JDFMedia media = (JDFMedia)thePreviousNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0); if (media != null && !EnumMediaType.Paper.Equals(media.getMediaType())) { media = (JDFMedia)thePreviousNode.getResource(ElementName.MEDIA, EnumUsage.Input, 1); } if (media != null && !EnumMediaType.Paper.Equals(media.getMediaType())) { media = null; } if (media == null) { media = getMediaFromNode(thePreviousNode); if (media == null) { VElement v = thePreviousNode.getPredecessors(true, false); if (v != null) { int siz = v.Count; for (int i = 0; i < siz; i++) { media = getMediaFromNode((JDFNode)v[i]); if (media != null) { break; } } } } } rlM = theNode.linkResource(media, EnumUsage.Input, null); } if (rlM == null && theParentNode != null) { rlM = theNode.linkResource(theParentNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0), EnumUsage.Input, null); } paperMedia = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, null, 0); paperMedia.setDescriptiveName("the paper to print on"); paperMedia.setResStatus(EnumResStatus.Unavailable, false); paperMedia.setMediaType(EnumMediaType.Paper); paperMedia.setDimensionCM(new JDFXYPair(70, 102)); paperMedia.setWeight(90); paperMedia.setThickness(90 / 0.8); return(paperMedia); }
public virtual void testMediaCatalog() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); jmf.setSenderID("DeviceSenderID"); JDFQuery q = jmf.appendQuery(EnumType.Resource); q.setXMLComment("This is the query for a catalog"); JDFResourceQuParams rqp = q.appendResourceQuParams(); rqp.setExact(true); rqp.setXMLComment("Scope=Allowed is a new attribute to describe that we want a complet list of all known resources"); rqp.setResourceName(ElementName.MEDIA); // rqp.setAttribute("Scope", "Allowed"); JDFResponse r = q.createResponse().getResponse(0); r = (JDFResponse)jmf.moveElement(r, null); r.setXMLComment("This is the response to the query - generally it will be in it's own jmf...\nThe list of ResourceInfo + the ResourceQuParams could also be specified in a Signal."); for (int i = 1; i < 5; i++) { JDFResourceInfo ri = r.appendResourceInfo(); ri.setResourceName("Media"); JDFMedia m = (JDFMedia)ri.appendResource("Media"); m.setDescriptiveName("Description of Media #" + i); m.setDimensionCM(new JDFXYPair(i * 10, 13 + i % 2 * 20)); m.setBrand("Brand #" + i); m.setProductID("ProductID_" + i); m.setMediaType(EnumMediaType.Paper); m.setResStatus((i < 2 ? EnumResStatus.Available : EnumResStatus.Unavailable), false); ri.setXMLComment("More attributes can be added as needed; Available = loaded"); } doc.write2File(sm_dirTestDataTemp + "MediaCatalog.jmf", 2, false); Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete)); }
public virtual void testStripMarks() { // TODO relativeSize AbsoluteSize NextPosition JDFElement.setLongID(false); n.getCreateResourcePool().appendXMLComment("StrippingParams with one sheet for simplicity", null); JDFMedia media = stripParams.appendMedia(); media.setDimensionCM(new JDFXYPair(100, 70)); JDFStrippingParams spS1 = (JDFStrippingParams)stripParams.addPartition(EnumPartIDKey.SheetName, "Sheet_1"); { JDFStripMark sm1 = spS1.appendStripMark(); sm1.setXMLComment("The following mark is on the press sheet (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the sheet\nThus the top center of the mark is rotated by 90° and placed exactly on (Position=0 0) the center right of the sheet\nNote that position is defined in absolute coordinates so that it alligns with Margin\nI propose deprecating StripMark/Position because the box paradigm does not fit well with resizeable marks."); sm1.setAttribute("MarkContext", "Sheet"); sm1.setMarkName("ColorControlStrip"); sm1.setMarkSide(EnumMarkSide.TwoSidedIndependent); sm1.setAttribute("Orientation", "Rotate90"); setNextAnchor(sm1, null, "CenterRight", "0 0", null, "Parent"); sm1.setAttribute("Anchor", "TopCenter"); sm1.appendElement(ElementName.COLORCONTROLSTRIP).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata"); } JDFStrippingParams spBS1 = (JDFStrippingParams)spS1.addPartition(EnumPartIDKey.BinderySignatureName, "BS_1"); JDFBinderySignature bs1 = spBS1.appendBinderySignature(); bs1.setNumberUp(new JDFXYPair(2, 4)); JDFPosition posBS1_1 = spBS1.appendPosition(); posBS1_1.setRelativeBox(new JDFRectangle(0, 0, 0.5, 1)); { JDFStripMark sm1_1 = spBS1.appendStripMark(); sm1_1.setXMLComment("The following describes a back to back mark on the folding signature (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the bindery signature.\nThus the center of the cutmark is positioned 5 pts left(-5) and 5 pts up(+5) from the bottom right of the bindery Signature"); sm1_1.setAttribute("MarkContext", "BinderySignature"); sm1_1.setMarkName("CutMark"); sm1_1.setMarkSide(EnumMarkSide.TwoSidedBackToBack); sm1_1.setAttribute("Orientation", "Rotate0"); sm1_1.setAttribute("Anchor", "Center"); setNextAnchor(sm1_1, null, "BottomRight", "-5 5", null, "Parent"); sm1_1.appendElement(ElementName.CUTMARK).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata"); } // TODO page cs vs. cell cs { JDFStripMark sm1_2 = spBS1.appendStripMark(); sm1_2.setXMLComment("The following describes a 4 back marks, one on each pair of Strip Cells (page) (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the spine of a pair of Page cells.\nThus the center of the bar code is positioned 0 pts right and 5 point up from the bottom spine of the cell page.\n Position is applied prior to rotating the mark."); sm1_2.setAttribute("MarkContext", "CellPair"); sm1_2.setMarkName("IdentificationField"); sm1_2.setMarkSide(EnumMarkSide.Back); sm1_2.setAttribute("Orientation", "Rotate90"); sm1_2.setAttribute("Anchor", "CenterLeft"); setNextAnchor(sm1_2, null, "BottomCenter", "5 0", null, "Parent"); sm1_2.appendElement(ElementName.IDENTIFICATIONFIELD).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata"); } { JDFStripMark sm1_3 = spBS1.appendStripMark(); sm1_3.setXMLComment("The following describes a back mark on each of the 8 Strip Cells (page) (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the bottom center of a Page cell.\nThus the center of the bar code is positioned 0 pts right and 5 point up from the bottom cell page."); sm1_3.setAttribute("MarkContext", "Cell"); sm1_3.setMarkName("IdentificationField"); sm1_3.setMarkSide(EnumMarkSide.Back); sm1_3.setAttribute("Orientation", "Rotate0"); sm1_3.setAttribute("Anchor", "BottomCenter"); setNextAnchor(sm1_3, null, "BottomCenter", "0 5", null, "Parent"); sm1_3.setAttribute("AbsoluteWidth", "20"); sm1_3.setAttribute("AbsoluteHeight", "10"); sm1_3.appendElement(ElementName.IDENTIFICATIONFIELD).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata"); } JDFStrippingParams spBS2 = (JDFStrippingParams)spS1.addPartition(EnumPartIDKey.BinderySignatureName, "BS_2"); spBS2.appendBinderySignature(); JDFPosition posBS2_1 = spBS2.appendPosition(); posBS2_1.setRelativeBox(new JDFRectangle(0.5, 0, 1, 0.5)); posBS2_1.setOrientation(EnumOrientation.Rotate270); JDFPosition posBS2_2 = spBS2.appendPosition(); posBS2_2.setRelativeBox(new JDFRectangle(0.5, 0.5, 1, 1)); posBS2_2.setOrientation(EnumOrientation.Flip90); { JDFStripMark sm2_1 = spBS2.appendStripMark(); sm2_1.setXMLComment("The following describes single sided barcode on the two folding signatures (see new Attribute: MarkContext)\n@Anchor defines the cs origin of the mark, @NextAnchor defines the cs origin of the container, in this case the 2 bindery signatures.\nThus the top left of the barcode is positioned 3 pts right(+3) and 3 pts below(-3) from the top left of the front side of the bindery Signature.\nSince ther are two position elements, this results in two marks:\nPosition one is rotated by 90 degrees so that the barcode remains on the front of the sheet. Due to the Position/@Rotation, the mark is also rotated by 90° on the press sheet\n Position 2 is also flipped so that the barcode eventually ends up on the back of the press sheet."); sm2_1.setAttribute("MarkContext", "BinderySignature"); sm2_1.setMarkName("IdentificationField"); sm2_1.setMarkSide(EnumMarkSide.Front); sm2_1.setAttribute("Orientation", "Rotate0"); sm2_1.setAttribute("Anchor", "TopLeft"); setNextAnchor(sm2_1, null, "TopLeft", "2 -3", null, "Parent"); string idAnchor = sm2_1.appendAnchor(null); sm2_1.appendElement(ElementName.IDENTIFICATIONFIELD).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata"); JDFStripMark sm2_2 = spBS2.appendStripMark(); sm2_2.setXMLComment("The following is a relatively positioned stripmark."); sm2_2.setAttribute("MarkContext", "BinderySignature"); sm2_1.setAttribute("Anchor", "BottomLeft"); sm2_2.setMarkName("RegisterMark"); sm2_2.setMarkSide(EnumMarkSide.Front); sm2_2.setAttribute("Orientation", "Rotate0"); sm2_2.appendElement(ElementName.REGISTERMARK).setXMLComment("The various explicit mark elements should be allowed here for their associated metatdata"); setNextAnchor(sm2_2, idAnchor, "BottomRight", "3 0", "This NextAnchor element refers to the previous barcode. the lower left of this is 3 points tothe right of the lower right of the referenced barcode.", "Sibling"); } d.write2File(sm_dirTestDataTemp + "StripMarks.jdf", 2, false); }