현재 인쇄 응용 프로그램을 작성 중입니다. 이 응용 프로그램은 특정 페이지가 프린터의 특정 용지함에서 나옵니다. 내가 인쇄해야XPSDocumentWriter - 특정 페이지를 특정 트레이에 인쇄
- 각 디스펜서 (일 주문)의 경우, : 실제 높은 수준에서
foreach (var dto in dispensersToPrint) { var documents = FilterDocumentSections(DispenserDocumentsToPrint.RetrieveByDispenserId(dto.DispenserId)); var groupedDocs = documents.GroupBy(t => t.DocumentTypeId); var queueName = Properties.Settings.Default.PrinterName; var queue = RawPrinterHelper.GetPrintQueue(queueName); var seq = new FixedDocumentSequence(); var xpsWriter = PrintQueue.CreateXpsDocumentWriter(queue); foreach (var docGroup in groupedDocs) { var printTicket = queue.DefaultPrintTicket.Clone(); var printTray = MapPrintTray((DocumentSectionType)docGroup.Key); if (!printTray.IsNullOrEmpty()) { printTicket = RawPrinterHelper.ModifyPrintTicket(printTicket, "psk:JobInputBin", printTray); } var fixedDoc = new FixedDocument(); fixedDoc.PrintTicket = printTicket; foreach (var doc in docGroup) { var pageContent = new PageContent(); var fixedPage = new FixedPage(); var localFileName = string.Empty; var unzippedFileName = string.Empty; //copy files locally localFileName = CopyFileToLocalMachine(doc.FileName); //unzip file unzippedFileName = EmfPrintingHelper.UnzipEmfFile(localFileName); var itemToPrint = new PrintableEmfImage { DataContext = new EmfImageViewModel { FileName = unzippedFileName } }; fixedPage.Children.Add(itemToPrint); pageContent.Child = fixedPage; fixedDoc.Pages.Add(pageContent); } var docRef = new DocumentReference(); docRef.SetDocument(fixedDoc); seq.References.Add(docRef); } xpsWriter.Write(seq); }
: 여기에 지금까지있어 무슨 배짱이다 먼저 DocumentType별로 그룹화하여 시작하십시오. (즉, 인쇄 유형 A를 용지함 1에 인쇄)
- 그런 다음 새 FixedDocumentSequence를 새로 만듭니다.
- 각 DocumentType에 대해; 그런 다음 고정 된 문서를 만듭니다. 그런 다음 인쇄 티켓을 수정하여 해당 용지함을 봅니다.
- 그런 다음 각 문서 유형에 대한 개별 페이지를 만듭니다. FixedDocument에 추가하십시오.
- FixedDocument의 건물이 완료되면; DocumentSequence에 추가합니다.
- 그런 다음 FixedDocumentSequence를 xpsWriter로 보냅니다.
하지만 어떤 이유로; 이 설정은 존중되지 않습니다. 나는 같은 문서함에서 모든 문서를 인쇄합니다.
은 여기 내 관찰의 일부까지입니다
- 인쇄 티켓의 수정 작업 수행; 수정 된 printTicket을 xpsWriter에 보내서 확인했습니다. 그러나 이것은 전체 작업에 설정을 적용합니다. 그것은 나를 위해 가지 않습니다.
- 내 인쇄 기능을 쿼리 할 때; 나는 JobInputBin 만 가지고 있다는 것을 알아 차렸다. 나는 이것이이 프린터가 기능을 지원하지 않는다는 것을 의미하지는 않는다고 생각합니다. 유사한 트레이 (Windows)에서 작동하는 멀티 트레이 (Multi-tray) 인쇄 (PageSettings.PaperSource 사용)
다음에 시도 할 수있는 아이디어가 있습니까? 누구든지 전에 이런 식으로 뭔가 성공 했습니까?