2017-02-06 15 views
0

利用規約のPDFをRDLレポートとして印刷しようとしています。問題は、レポートそのものが画像のキューであるのに対して、T &のCはPDF形式であるということです。したがって、ストリームに追加する「エンキュー」を行うたびに、2ページではなく1つの大きな画像のようなPDFが表示されます。これにより、GDI +ジェネリックスエラーが発生します。 PDFを適切な画像形式に変換してこれらの文書を組み合わせることができますか?ここで私がこれまで持っているコードです:私は戻ってバイト配列にイメージに契約条件を変換しようとした、としましたPDFを画像に追加ReportViewer

internal static void DoPrintInvoice(int orderID, SalesOrderBLL.DocumentType doctype, string printer, int copies, List<string> lines) 
    { 
     using (var context = rempscoDataContext.CreateReadOnlyContext()) 
     using (MiniProfiler.Current.Step("DoPrintInvoice()")) 
     { 
      //Customer Opt-Out 

      // Generate Report 
      using (var report = GetSalesOrderReport(orderID, _DocumentTypeDescriptions[doctype], doctype != DocumentType.InvoiceLetterhead, lines)) 
      { 

       // returns queue of streams. 
       var streams = PrintingBLL.RenderStreams(report, landscape: false); 
       // returns byte array 
       var TermsAndConditions = GetTermsAndConditions(); 

       //convert byte array to memory stream. 
       var TCStream = new MemoryStream(TermsAndConditions); 

       //conditional to add T&C's to stream. 
       if (doctype == DocumentType.OrderAcknowledgement) 
       { 
        streams.Enqueue(TCStream); 
       } 

       ParallelInvoke(
         () => SaveSalesOrderPDF(orderID, doctype, report), 
         () => PrintingBLL.PrintStreams(streams, string.Format("Sales Order ({0})", report.DisplayName), printer, copies, false) 
         ); 
      } 
     } 
    } 

が、それは私に同じGDI一般的な問題を提供します。どんな助けでも大歓迎です!

答えて

0

PDFSharpを見ましたか?私はPDFをレンダリングするために過去にそれに取り組んできました。

www.pdfsharp.com

関連する問題