0

過去に同様の質問をしたことがありますが、それ以来、問題を解決する喜びがありませんでした。私は Xps ドキュメントの専門家ではありませんが、私の問題をこれに突き止めることができました...

次の例では、DocumentPaginator引数を取り、ドキュメントを単純に印刷します。最初の例は機能しますが、2 番目の例はドキュメントに埋め込まれた画像を印刷しません。

// this works

XpsDocumentWriter xpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(printQueue);
xpsDocumentWriter.Write(document);  // where document is a DocumentPaginator

// this doesn't work (it prints but no images)

// create new doc
XpsDocument doc = new XpsDocument(package, CompressionOption.NotCompressed, "pack://TempTemporaryPackageUri.xps");

// create writer for new doc
XpsDocumentWriter writer = XpsDocument.CreateXpsDocumentWriter(doc);

// write document
writer.Write(document, printQueue.DefaultPrintTicket);

// create writer for print job
XpsDocumentWriter xpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(printQueue);

// i think it's here where the resources are being lost 

// write document
xpsDocumentWriter.Write(doc.GetFixedDocumentSequence());

新しいドキュメントを作成する必要があるのは、ページ付けされた XpsDocument を操作する必要があるためです。

あるドキュメントから別のドキュメントにリソースをコピーできることに関して、誰かが私を正しい方向に向けることができますか?

アドバイスをいただければ幸いです。

前もって感謝します、

サム

4

1 に答える 1

0

以下のリンクにあるコードを試すことができます。XPSおよびPDF形式への変換に取り組んでいます。

http://msdn.microsoft.com/en-us/library/bb412305(v=office.12).aspx

于 2012-04-23T11:36:37.283 に答える