示例#1
0
        private JDFLayoutElementPart addLayoutElementPart(JDFLayoutElementProductionParams lep, JDFContentList cl)
        {
            JDFLayoutElementPart lePart = lep.appendLayoutElementPart();

            addMetaData(cl, lePart);
            return(lePart);
        }
示例#2
0
        ///
        ///	 <summary> *  </summary>
        ///
        private void initLayoutElementProductionParams()
        {
            JDFLayoutElementProductionParams lep = (JDFLayoutElementProductionParams)theNode.getCreateResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumUsage.Input, 0);
            JDFBarcodeProductionParams       bp  = lep.getCreateLayoutElementPart(0).appendBarcodeProductionParams();
            JDFIdentificationField           idf = bp.appendIdentificationField();

            idf.setEncoding(EnumEncoding.Barcode);
            idf.setEncodingDetails("EAN");
            idf.setValue("123456");
        }
示例#3
0
 private void iterateRead(int i)
 {
     iterDoc = JDFDoc.parseFile(getIteration(i));
     Assert.IsNotNull(iterDoc);
     iterNode = iterDoc.getJDFRoot();
     Assert.IsNotNull(iterNode);
     iterLepp = (JDFLayoutElementProductionParams)iterNode.getMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null, 0);
     Assert.IsNotNull(iterLepp);
     iterApp = (JDFApprovalParams)iterNode.getMatchingResource(ElementName.APPROVALPARAMS, EnumProcessUsage.AnyInput, null, 0);
     Assert.IsNotNull(iterApp);
     iterAppSuccess = (JDFApprovalSuccess)iterNode.getMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyInput, null, 0);
     Assert.IsNotNull(iterAppSuccess);
     iterRuli = (JDFRunList)iterNode.getMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null, 0);
     Assert.IsNotNull(iterRuli);
 }
示例#4
0
        public virtual void testLayoutPreflight()
        {
            JDFElement.setLongID(false);
            JDFDoc d = new JDFDoc("JDF");

            n = d.getJDFRoot();
            n.setType(EnumType.LayoutElementProduction);

            JDFRunList outRun = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null);

            outRun.setFileURL("output.pdf");

            JDFLayoutElementProductionParams lep = (JDFLayoutElementProductionParams)n.appendMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null);
            JDFComment com = lep.appendComment();

            com.setName("Instruction");
            com.setText("Add any human readable instructions here");

            // new
            aPool = (JDFActionPool)lep.appendElement(ElementName.ACTIONPOOL);

            // now some simple tests...
            appendNumPagesAction();
            appendSeparationAction();
            appendBWSeparationAction();
            appendTrimBoxAction();
            appendResolutionAction();
            StatusUtil su = new StatusUtil(n, null, null);

            su.setPhase(EnumNodeStatus.InProgress, "Creative Work", EnumDeviceStatus.Running, null, null);

            su.getDocJMFPhaseTime();
            Thread.Sleep(1000);
            su = new StatusUtil(n, null, null);
            su.setPhase(EnumNodeStatus.InProgress, "Creative Work", EnumDeviceStatus.Running, null, null);
            su.getDocJMFPhaseTime();
            Thread.Sleep(1000);
            su = new StatusUtil(n, null, null);
            su.setPhase(EnumNodeStatus.Completed, "done", EnumDeviceStatus.Idle, null, null);
            su.getDocJMFPhaseTime();
            d.write2File(sm_dirTestDataTemp + "LayoutPreflight.jdf", 2, false);
        }
示例#5
0
        private void iterateSetup()
        {
            iterDoc  = new JDFDoc("JDF");
            iterNode = iterDoc.getJDFRoot();
            iterNode.setCombined(new VString("LayoutElementProduction Approval", " "));
            iterNode.setStatus(EnumNodeStatus.Waiting);
            iterLepp = (JDFLayoutElementProductionParams)iterNode.appendMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null);
            iterLepp.setResStatus(EnumResStatus.Available, true);
            iterApp = (JDFApprovalParams)iterNode.appendMatchingResource(ElementName.APPROVALPARAMS, EnumProcessUsage.AnyInput, null);
            iterApp.setResStatus(EnumResStatus.Available, true);
            iterAppSuccess = (JDFApprovalSuccess)iterNode.appendMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyInput, null);
            iterAppSuccess.setResStatus(EnumResStatus.Unavailable, true);
            iterRuli = (JDFRunList)iterNode.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null);
            iterRuli.setResStatus(EnumResStatus.Unavailable, true);
            inRuli = (JDFRunList)iterNode.addResource(ElementName.RUNLIST, null, EnumUsage.Input, null, null, null, null);
            inRuli.setResStatus(EnumResStatus.Available, true);

            iterRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Myinput.pdf", true), 0, 3);
            iterRuli.setDescriptiveName("save in place - input equals output");
            inRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Myinput.pdf", true), 0, 3);
            inRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Image1.pdf", true), 0, 0);
            inRuli.addPDF(StringUtil.uncToUrl("C:\\local\\Image2.pdf", true), 0, 0);
            iterDoc.write2File(getIteration(0), 2, false);
        }
示例#6
0
        public virtual void testLayoutElementPositioning()
        {
            // TBD: Fuzzy, Sizes, literal text via comments
            JDFElement.setLongID(false);
            JDFDoc d = new JDFDoc("JDF");

            n = d.getJDFRoot();
            n.setType(EnumType.LayoutElementProduction);

            JDFRunList outRun = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null);

            outRun.setFileURL("output.pdf");

            JDFLayoutElementProductionParams lep = (JDFLayoutElementProductionParams)n.appendMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null);

            lep.appendXMLComment("This is a \"well placed\" CTM defined mark\nThe anchor defines the 0,0 point to be transformed\nThe element to be placed is referenced by LayoutElement/FileSpec/URL", null);

            JDFContentList cl = (JDFContentList)lep.appendElement(ElementName.CONTENTLIST);

            cl = (JDFContentList)cl.makeRootResource(null, null, true);
            cl.setXMLComment("this is an optional metadatapool for the content");

            JDFLayoutElementPart lePart      = addLayoutElementPart(lep, cl);
            KElement             positionObj = lePart.appendElement("PositionObject");

            positionObj.setAttribute("PageRange", "0");
            setNextAnchor(positionObj, null, "LowLeft", "0 0", null, "Parent", 0);
            positionObj.setAttribute("Anchor", "LowLeft");
            positionObj.setAttribute("PositionPolicy", "Exact");
            JDFLayoutElement bkg = (JDFLayoutElement)lePart.appendElement("LayoutElement");

            bkg.setMimeURL("bkg.pdf");

            lep.appendXMLComment("This is a \"roughly placed\" reservation in the middle of the page", null);
            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "0");
            // TODO discuss individual positions
            setNextAnchor(positionObj, null, "Center", null, null, "Parent", 0);
            positionObj.setAttribute("Anchor", "Center");
            positionObj.setAttribute("PositionPolicy", "Free");
            string id = lePart.appendAnchor(null);

            JDFLayoutElement image = (JDFLayoutElement)lePart.appendElement("LayoutElement");

            image.setElementType(EnumElementType.Image);
            image.appendComment().setText("Please add an image of a palm tree on a beach here!");

            lep.appendXMLComment("This is a \"roughly placed\" reservation 36 points below the previous image;\n NextPosition points from Anchor on this to NextAnchor on next,\n i.e. a positive vector specifies that next is shifted in the positive direction in the parent (in this case page) coordinate system", null);
            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "0");
            positionObj.setAttribute("Anchor", "TopCenter");
            positionObj.setAttribute("PositionPolicy", "Free");
            setNextAnchor(positionObj, id, "BottomCenter", "0 36", null, "Sibling", 0);

            image = (JDFLayoutElement)lePart.appendElement("LayoutElement");
            image.setElementType(EnumElementType.Image);
            image.appendComment().setText("Please add an image of a beach ball below the palm tree!");

            lep.appendXMLComment("This is a \"well placed\" CTM defined mark\nThe anchor defines the 0,0 point to be transformed", null);
            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "0");
            setNextAnchor(positionObj, null, "BottomLeft", "2 3", null, "Parent", 0);
            positionObj.setAttribute("Anchor", "LowLeft");
            positionObj.setAttribute("PositionPolicy", "Exact");
            lePart.appendBarcodeProductionParams().appendXMLComment("barcode details here", null);

            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "0");
            setNextAnchor(positionObj, null, "TopRight", null, null, "Parent", 0);
            positionObj.setAttribute("Anchor", "TopRight");
            positionObj.appendXMLComment("This is a \"roughly placed\"  mark\nThe anchor at top right is placed at the right (=1.0) top(=1.0) position of the page.\nNo rotation is specified", null);
            positionObj.setAttribute("PositionPolicy", "Exact");
            lePart.appendBarcodeProductionParams().appendXMLComment("barcode details here", null);
            lep.appendXMLComment("This is a \"roughly placed\"  container for marks\nThe anchor at top left is defined in the !Unrotated! orientation.\n It is placed at the left (=0.0) bottom(=0.0) position of the page.\nThe text flows bottom to top (=Rotate 90 = counterclockwise)\n do we need margins?", null);

            lePart = addLayoutElementPart(lep, cl);
            string idParent = lePart.appendAnchor(null);

            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "1");
            positionObj.setAttribute("Anchor", "TopLeft");
            positionObj.setAttribute("PositionPolicy", "Free");
            setNextAnchor(positionObj, null, "BottomCenter", "0 0", null, "Parent", 90);
            lep.appendXMLComment("This is a  barcode inside the previous container\nThe anchor at bottom left is defined in the !Unrotated! orientation.\n It is placed at the left (=0.0) bottom(=0.0) position of the container.", null);

            lePart      = addLayoutElementPart(lep, cl);
            id          = lePart.appendAnchor(null);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("Anchor", "BottomLeft");
            setNextAnchor(positionObj, idParent, "BottomLeft", "0 0", null, "Parent", 0);
            lePart.appendBarcodeProductionParams().appendXMLComment("barcode details here", null);
            lep.appendXMLComment("This is a disclaimer text inside the previous container\nThe anchor at top left is defined in the !Unrotated! orientation.\n The barcode and text are justified with their top margins and spaced by 72 points\n which corresponds to the left of the page because the container is rotated 90°\n" + "AbsoluteSize specifies the size of the object in points", null);

            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            setNextAnchor(positionObj, id, "TopRight", "-72 0", null, "Sibling", 0);

            positionObj.setAttribute("Anchor", "TopLeft");
            // positionObj.setAttribute("ParentRef", idParent);
            positionObj.setAttribute("AbsoluteSize", "300 200");
            JDFLayoutElement text = (JDFLayoutElement)lePart.appendElement("LayoutElement");

            text.setElementType(EnumElementType.Text);
            text.setMimeURL("file://myServer/disclaimers/de/aspirin.txt");
            lep.appendXMLComment("This is a \"VERY roughly placed\" piece of text somewhere on pages 2-3\n" + "RelativeSize specifies the size of the object as a ratio of the size of the container", null);

            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "1 ~ 2");
            positionObj.setAttribute("RelativeSize", "0.8 0.5");
            text = (JDFLayoutElement)lePart.appendElement("LayoutElement");
            text.setElementType(EnumElementType.Text);
            JDFComment instructionComment = text.appendComment();

            instructionComment.setName("Instructions");
            instructionComment.setText("Please add some text about the image of a palm tree on a beach here!");
            lep.appendXMLComment("This is another \"VERY roughly placed\" piece of text somewhere on pages 2-3; the text source is the JDF", null);

            lePart      = addLayoutElementPart(lep, cl);
            positionObj = lePart.appendElement("PositionObject");
            positionObj.setAttribute("PageRange", "1 ~ 2");
            text = (JDFLayoutElement)lePart.appendElement("LayoutElement");
            text.setElementType(EnumElementType.Text);

            JDFComment textSrc = text.appendComment();

            textSrc.setName("TextInput");
            textSrc.setText("Laurum Ipsum Blah blah blah!\n btw. this is unformatted plain text and nothing else!");

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