@Darin Dimitrov がこのリンクで asp.net を Web サービスに変換するのを手伝ってくれて幸運でした:
今回は、以下のコードを変換しようとしましたが、問題がありました。
これが変換しようとしているコードで、その後に変換の試みが続きます。
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using EO.Pdf;
using System.Collections.Specialized;
partial class ToDems : System.Web.UI.Page
{
private void // ERROR: Handles clauses are not supported in C#
Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack) {
string itemList = Request.QueryString("from");
string[] items = Strings.Split(itemList, ",");
//Create a PdfDocument object
PdfDocument doc = new PdfDocument();
string item = null;
foreach ( item in items) {
HtmlToPdf.ConvertUrl(url, doc);
}
//We present "Save As" dialog
doc.Save(Response.OutputStream);
}
}
}
これは私が試したものですが、リストとループについて混乱しています。
public class ToDems : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string itemList = context.Request.QueryString["from"];
string items = context.Strings.Split(itemList, ",");
PdfDocument doc = new PdfDocument();
string item = null;
foreach ( item in items)
{
HtmlToPdf.ConvertUrl(url, doc);
}
doc.Save(context.Response.OutputStream);
}
public bool IsReusable
{
get { return false; }
}
}
私は何を間違っていますか?