예제 #1
0
        public virtual void testAutomateLayout2()
        {
            n.setXMLComment("This another example of an automated layout\n" + "The structure is aligned close to a static Layout but additionally uses OrdExpression and allows for varying numbers of pages in the runlist\n" + "note that the actual processes and outputs have been omitted for brevity");

            setUpAutomatedInputRunList();
            rl.setDescriptiveName("This is a RunList specifiying 100 instance documents of varying pages each in a ppml file");

            lo = (JDFLayout)n.appendMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null);
            lo.setResStatus(EnumResStatus.Available, true);

            lo.setMaxDocOrd(1);
            lo.setAutomated(true);
            lo.appendXMLComment("Layout for 2 Cover pages and varying numbers of 2 up two sided body pages\n" + "The number of pages per instance document varies\n" + "MaxDocOrd is set to 1. This is redundant since 1 is the default.\n" + "A value of 1 explicitly resets all counters at a Document break.", null);
            JDFLayout cover = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Cover");

            cover.appendXMLComment("In this example, the cover is assumed to be the first two pages of each runlist\n" + "\n!!! We unfortunately have an issue here:\n" + "we cannot differentiate whether the cover should be repeated of not, i.e. whether the cover is executed once (the correct choice) or repeated between each body sheet.\n" + "Note that no MaxOrd is not set, as it varies between documents", null);
            cover.setDescriptiveName("one sided cover - the inner = back side is empty");
            JDFLayout        coverFront = (JDFLayout)cover.addPartition(EnumPartIDKey.Side, EnumSide.Front);
            JDFContentObject co         = coverFront.appendContentObject();

            co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0));
            co.setOrdExpression("1");
            co.setDescriptiveName("Front Cover Page");
            co = coverFront.appendContentObject();
            co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0));
            co.setOrdExpression("0");
            co.setDescriptiveName("Back Cover Page - (back of brochure but front of sheet)");

            JDFLayout body = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Body");

            body.setDescriptiveName("abstract description of multiple body sheets");
            JDFLayout bodySide = (JDFLayout)body.addPartition(EnumPartIDKey.Side, EnumSide.Front);

            co = bodySide.appendContentObject();
            co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0));
            co.setOrdExpression("4 * (n+3)/4 - s*2 +1");
            co.setDescriptiveName("Left Front Sheet Body Page");
            co = bodySide.appendContentObject();
            co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0));
            co.setOrdExpression("2*s +2");
            co.setDescriptiveName("Right Front Sheet Body Page");

            bodySide = (JDFLayout)body.addPartition(EnumPartIDKey.Side, EnumSide.Back);

            co = bodySide.appendContentObject();
            co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0));
            co.setOrdExpression("2*s +3");
            co.setDescriptiveName("Left Back Sheet Body Page");
            co = bodySide.appendContentObject();
            co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0));
            co.setOrdExpression("4 * (n+3)/4 - s*2 +0");
            co.setDescriptiveName("Right Back Sheet Body Page");

            doc.write2File(sm_dirTestDataTemp + "AutomatedLayout2.jdf", 2, false);
        }