/// /// <summary> * </summary> /// protected internal virtual JDFRunList initDocumentRunList() { JDFRunList rl = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Input, 0); JDFResourceLink rll = theNode.getLink(rl, null); if ("Marks".Equals(rll.getProcessUsage())) { rl = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Input, 1); rll = theNode.getLink(rl, null); } rll.setProcessUsage(EnumProcessUsage.Document); rl.addPDF(m_pdfFile, 0, -1); rl.setNPage(4); rl.setDescriptiveName("Description of this RunList"); return(rl); }
public virtual void testVariableManifests() { ruli.setXMLComment("the set / doc / ... structure is transferred from the pre-impositioning pdl"); JDFPageList pl = (JDFPageList)n.addResource(ElementName.PAGELIST, null); pl.setResStatus(EnumResStatus.Available, false); JDFContentList cl = (JDFContentList)pl.appendContentList().makeRootResource(null, null, true); cl.setResStatus(EnumResStatus.Available, false); cl.setXMLComment("Should we allow for content-data cross references to forther contentdata fields?"); ruli.refPageList(pl); comp.refPageList(pl); int pageCount = 0; digiParams.setSides(EnumSides.TwoSidedFlipY); digiParams.setXMLComment("the sides attribute may be overridden by explicitly or implicitly missing runlist input elements"); VString vRun = new VString("Letter BrochureMale BrochureFemale", null); JDFStitchingParams sp = (JDFStitchingParams)n.addResource(ElementName.STITCHINGPARAMS, EnumUsage.Input); med.setXMLComment("Media Partitioning is convenience only- the actual media selection is done by the digitalprintingparams MediaRef"); for (int i = 0; i < vRun.Count; i++) { string part = vRun[i]; JDFMedia partMedia = (JDFMedia)med.addPartition(EnumPartIDKey.Run, part); partMedia.setProductID(part + "Media"); JDFDigitalPrintingParams digiPart = (JDFDigitalPrintingParams)digiParams.addPartition(EnumPartIDKey.Run, part); digiPart.refMedia(partMedia); sp.setXMLComment("how are multiple runs stitched together e.g. cover + body?"); JDFStitchingParams spPart = (JDFStitchingParams)sp.addPartition(EnumPartIDKey.Run, part); if (i == 0) { spPart.setNoOp(true); spPart.setDescriptiveName("The letter is a loose leaf collection"); } else { spPart.setNumberOfStitches(3); spPart.setStitchType(EnumStitchType.Saddle); } } // loop over records for (int i = 0; i < 10; i++) { JDFContentData letter = cl.appendContentData(); letter.setContentType("Letter"); JDFContentData brochure = cl.appendContentData(); brochure.setContentType("Brochure"); KElement lMeta = letter.appendElement("ContentMetadata"); // TODO apply new example lMeta.setAttribute("Record", "" + i); string gender = i % 2 == 0 ? "Male" : "Female"; lMeta.setAttribute("Gender", gender); lMeta.setXMLComment("Note that the final format of the metadata element is open"); KElement bMeta = brochure.appendElement("Metadata"); bMeta.setAttribute("Record", "" + i); bMeta.setAttribute("Gender", gender); JDFRunList runSet = (JDFRunList)ruli.addPartition(EnumPartIDKey.RunSet, "Record" + i); JDFRunList run = runSet.addRun("file://server/tifs/testLetter" + i + ".tif", 0, -1); run.setRun("Letter"); JDFComponent compSet = (JDFComponent)comp.addPartition(EnumPartIDKey.RunSet, runSet.getRunSet()); JDFComponent co = (JDFComponent)compSet.addPartition(EnumPartIDKey.Run, run.getRun()); int page = (3 * i) % 7 + 1; run.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1))); co.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1))); co.setSurfaceCount(2 * ((page + 1) / 2)); run.setPages(new JDFIntegerRangeList("0~" + (page - 1))); run.setXMLComment("Cover Letter - record " + i); run.setEndOfDocument(true); JDFPageData pd = pl.appendPageData(); pd.refContentData(letter); pd.setAttribute("PageIndex", pageCount + " ~ " + (pageCount + page - 1)); pageCount += page; run = runSet.addRun("file://server/tifs/testBrochure" + i + ".tif", 0, -1); run.setRun("Brochure" + gender); co = (JDFComponent)compSet.addPartition(EnumPartIDKey.Run, run.getRun()); page = 2 * ((7 * i) % 13) + 2; run.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1))); co.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1))); co.setSurfaceCount(2 * ((page + 1 + 1) / 2)); // the 2nd +1 is for // the blank inside // cover run.setPages(new JDFIntegerRangeList("0~" + (page - 1))); run.setXMLComment("Brochure - record " + i); run.setEndOfDocument(true); runSet.setEndOfSet(true); run.setAttribute("SkipBlankOrds", "1"); run.setNPage(page + 1); run.setXMLComment("SkipBlankOrds specifies the relative position of pages to skip\n1 specifies that the first back sheet is skipped\nNPage MUST be incremented by the # of skipped pages."); pd = pl.appendPageData(); pd.refContentData(brochure); pd.setAttribute("PageIndex", pageCount + " ~ " + (pageCount + page - 1)); pageCount += page; } doc.write2File(sm_dirTestDataTemp + "RunlistManifest.jdf", 2, false); }
public virtual void testAutomateLayout_PlateSet() { for (int loop = 0; loop < 3; loop++) { n.getAuditPool().appendXMLComment("This is a simple example of an automated layout used for conventional prepress\n" + "The structure is aligned as closely as possible with a static Layout", null); JDFRunList run = rl.addRun("file://host/data/test.pdf", 0, -1); run.setNPage(128); rl.setResStatus(EnumResStatus.Available, true); rl.setDescriptiveName("This is a RunList specifiying 128 pages each in a pdf file."); lo = (JDFLayout)n.appendMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null); lo.setResStatus(EnumResStatus.Available, true); lo.setMaxOrd(4); lo.setAutomated(true); const string format = "Sheet%02i"; lo.setAttribute("NameFormat", format); lo.setAttribute("NameTemplate", "SheetNum"); lo.appendXMLComment("Simple automated Layout with exactly one sheet\n", null); JDFLayout sheet = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Sheet"); sheet.setDescriptiveName("two sided 2 up sheet"); JDFLayout sheetFront = (JDFLayout)sheet.addPartition(EnumPartIDKey.Side, EnumSide.Front); JDFContentObject co = sheetFront.appendContentObject(); co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0)); co.setOrd(0); co.setDescriptiveName("Front 1st, 5th, 9th... Page"); co = sheetFront.appendContentObject(); co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0)); co.setOrd(1); co.setDescriptiveName("Front 2nd, 6th, 10th... page"); JDFLayout sheetBack = (JDFLayout)sheet.addPartition(EnumPartIDKey.Side, EnumSide.Back); co = sheetBack.appendContentObject(); co.setCTM(new JDFMatrix(1, 0, 0, 1, 0, 0)); co.setOrd(2); co.setDescriptiveName("Back 3rd, 7th, 11th... Page"); co = sheetBack.appendContentObject(); co.setCTM(new JDFMatrix(1, 0, 0, 1, 8.5 * 72, 0)); co.setOrd(3); co.setDescriptiveName("Back 4th, 8th, 12th... page"); JDFRunList rlSheet = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null); rlSheet.setDirectory("file://host/out/"); if (loop == 0) // instantiate individually { PrintfFormat fmt = new PrintfFormat(format); for (int i = 0; i < 128; i += 4) { string sheetName = fmt.tostr(1 + i / 4); JDFRunList rlp = (JDFRunList)rlSheet.addPartition(EnumPartIDKey.SheetName, sheetName); JDFRunList rlF = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Front); rlF.appendLayoutElement().setMimeURL(sheetName + "Front.pdf"); JDFRunList rlB = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Back); rlB.appendLayoutElement().setMimeURL(sheetName + "Back.pdf"); } } if (loop == 1) // instantiate individually { rlSheet.appendLayoutElement().setMimeURL("AllSheets.pdf"); PrintfFormat fmt = new PrintfFormat(format); JDFIntegerRangeList integerRangeList = new JDFIntegerRangeList(); for (int i = 0; i < 128; i += 4) { string sheetName = fmt.tostr(1 + i / 4); JDFRunList rlp = (JDFRunList)rlSheet.addPartition(EnumPartIDKey.SheetName, sheetName); JDFRunList rlF = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Front); integerRangeList.Clear(); integerRangeList.Append(i / 2); rlF.setPages(integerRangeList); JDFRunList rlB = (JDFRunList)rlp.addPartition(EnumPartIDKey.Side, EnumSide.Back); integerRangeList.Clear(); integerRangeList.Append(1 + i / 2); rlB.setPages(integerRangeList); } } else // instantiate by template { JDFFileSpec fs = rlSheet.appendLayoutElement().appendFileSpec(); fs.setMimeType("application/pdf"); fs.setFileFormat(format + "%s_%s.pdf"); fs.setFileTemplate("SheetNum,Surface,Separation"); } doc.write2File(sm_dirTestDataTemp + "AutomatedLayout_Plateset" + loop + ".jdf", 2, false); n.getResourceLinkPool().deleteNode(); n.getResourcePool().deleteNode(); } }
public virtual void testFoldOut() { // 0=1.3; 2=1.4 for (int i = 0; i < 3; i++) { if (i == 1) { continue; // rejected by wg } reSetUp(); n.setXMLComment("Stripping Foldout example corresponding to spec example n.6.5 - verion: " + ((i == 0) ? "multi-Cell" : ((i == 1) ? "new attribute FoldOutTrimSize" : "new attribute FaceCells (Accepted for 1.4)"))); rl.setNPage(6); sp.setResStatus(EnumResStatus.Available, true); bs.setResStatus(EnumResStatus.Available, true); JDFSignatureCell sc = bs.appendSignatureCell(); sc.setXMLComment("this is the foldout foldout cell"); sc.setFrontPages(new JDFIntegerList("4")); sc.setBackPages(new JDFIntegerList("3")); if (i == 0 || i == 2) { sc = bs.appendSignatureCell(); string xmlComment = "this cell is the inner page of the foldout, i.e. the page that is attached to the spine"; sc.setFrontPages(new JDFIntegerList("5")); sc.setBackPages(new JDFIntegerList("2")); if (i == 0) { sc.setFrontFacePages(new JDFIntegerList("4")); sc.setBackFacePages(new JDFIntegerList("3")); } else { xmlComment += "\nThe new attribute FaceCells refers to the cell(s) that describe the foldout; in this case the cell to the left."; xmlComment += "\nThe front and back pages of the foldout are listed in the respective cell(s)"; sc.setAttribute("FaceCells", "0"); } sc.setXMLComment(xmlComment); } sc = bs.appendSignatureCell(); sc.setXMLComment("this is the cell that has no foldout"); sc.setFrontPages(new JDFIntegerList("0")); sc.setBackPages(new JDFIntegerList("1")); JDFStrippingParams sp1 = (JDFStrippingParams)sp.addPartition(EnumPartIDKey.CellIndex, "0"); JDFStripCellParams scp = sp1.appendStripCellParams(); scp.setTrimSize(new JDFXYPair(200 + (i % 2) * 300, 400)); if (i != 1) { scp.setXMLComment("stripcell for the folded out foldout(front page=4)"); } else { scp.setXMLComment("stripcell for the entire foldout(front page=4, foldout page =5)\nthe TrimSize applies to the entire foldout spread (page 4 and 5)\n note the new FoldoutTrimSize attribute"); } if (i != 1) { sp1 = (JDFStrippingParams)sp.addPartition(EnumPartIDKey.CellIndex, "1"); scp = sp1.appendStripCellParams(); scp.setTrimSize(new JDFXYPair(300, 400)); scp.setXMLComment("stripcell for the inner page of the foldout foldout(front page=5)"); } else { scp.setAttribute("FoldoutTrimSize", "200 400"); } sp1 = (JDFStrippingParams)sp.addPartition(EnumPartIDKey.CellIndex, i != 1 ? "2" : "1"); scp = sp1.appendStripCellParams(); scp.setTrimSize(new JDFXYPair(320, 400)); scp.setXMLComment("stripcell for the inner page of the foldout foldout(front page=0)"); doc.write2File(sm_dirTestDataTemp + "foldoutStrip" + i + ".jdf", 2, false); } }