コード例 #1
0
        ///
        ///     <summary> * Get all PRItem from the current element
        ///     *  </summary>
        ///     * <returns> Collection<JDFPRItem> </returns>
        ///
        public virtual ICollection <JDFPRItem> getAllPRItem()
        {
            List <JDFPRItem> v = new List <JDFPRItem>();

            JDFPRItem kElem = (JDFPRItem)getFirstChildElement(ElementName.PRITEM, null);

            while (kElem != null)
            {
                v.Add(kElem);

                kElem = (JDFPRItem)kElem.getNextSiblingElement(ElementName.PRITEM, null);
            }

            return(v);
        }
コード例 #2
0
ファイル: PreflightTest.cs プロジェクト: cip4/JDFLibNet
        public virtual void testPreflightReport()
        {
            testPreflightProfile();
            JDFPreflightReport prp = (JDFPreflightReport)n.appendMatchingResource(ElementName.PREFLIGHTREPORT, EnumProcessUsage.AnyOutput, null);

            prp.refElement(preparms);
            prp.refElement(inRun);
            prp.refElement(prrp);

            JDFAttributeMap prMap   = new JDFAttributeMap();
            VString         groupBy = new VString();

            prMap.put("CompressionTypes", "JPEG");
            prMap.put("PageNumber", "2");
            groupBy.Add("PageNumber");
            JDFPRItem pi = prp.setPR(aPool.getAction(0), 2, prMap, groupBy);

            Assert.IsNotNull(pi);
            Assert.AreEqual(1, pi.getOccurrences());
            prMap.put("CompressionTypes", "JPEG2000");
            JDFPRItem pi2 = prp.setPR(aPool.getAction(0), 2, prMap, groupBy);

            Assert.IsNotNull(pi2);
            Assert.AreEqual(2, pi2.getOccurrences());
            Assert.AreEqual(pi, pi2);
            prMap.put("PageNumber", "3");
            JDFPRItem pi3 = prp.setPR(aPool.getAction(0), 3, prMap, groupBy);

            Assert.IsNotNull(pi3);
            Assert.AreEqual(3, pi3.getOccurrences());
            Assert.AreEqual(pi3, pi);
            Assert.AreEqual(new JDFIntegerRangeList("2 ~ 3"), pi.getPageSet());
            JDFPRItem pi4 = prp.setPR(aPool.getAction(1), 3, null, null);

            Assert.AreEqual(1, pi4.getOccurrences());
            Assert.AreNotEqual(pi, pi4);
            Assert.AreEqual(new JDFIntegerRangeList("3"), pi4.getPageSet());

            Assert.AreEqual(2, prp.numChildElements(ElementName.PRITEM, null));
            n.getOwnerDocument_KElement().write2File(sm_dirTestDataTemp + "PreflightReport.jdf", 2, false);
        }