0

私は一生、作成しているクラスをクライアントに表示する方法を理解できません。私は次のクラスを持っています:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Server;
using System.ServiceModel;

namespace Test1.Web
{
    [EnableClientAccess]
    public class CreatePDF  
    {


        public string paragraph { get; set; }
        public CreatePDF()
        { }

        public void GoGoGadgetPDF()
        {
            var document = new Document();
            string path = HttpContext.Current.Server.MapPath("PDFs");
            PdfWriter.GetInstance(document, new FileStream(path + "/document.pdf", FileMode.Create));
            document.Open();
            document.Add(new Paragraph(paragraph));
            document.Close();
        }
    }
}

フォルダー構造の Web プロジェクトの直下にクラスを配置します。

  • Test1.Web
    • 参考文献
    • ClientBin (フォルダ)
    • モデル(フォルダ)
    • 作成したPDF.cs
    • Authentication.cs

models フォルダー内の DomainService クラスと Authentication.cs クラスにアクセスできます。ただし、CreatePDF ではありません。

どんな助けでも大歓迎です!!

4

1 に答える 1

0

私は自分の答えを見つけました。私のRIAサービスはPDFの作成とは何の関係もありません。WCFサービスを追加し、代わりにそれを使用しました。

于 2013-02-13T20:47:57.580 に答える