[Mono-list] 3rd party dlls - ABCpdf
louaish88
louaish88 at hotmail.com
Tue Mar 20 14:19:22 EDT 2007
Here is the code that works fine in windows:
<=============================================>
<%@ WebHandler Language="C#" Class="pdfgen" %>
using System;
using System.Web;
using WebSupergoo;
using WebSupergoo.ABCpdf6;
public class pdfgen : IHttpHandler {
HttpContext context;
public void ProcessRequest(HttpContext c) {
context = c;
try {
DoRequest();
} catch (Exception e) {
context.Response.Write("SERVER\nException: " + e.ToString() + "\n");
}
}
void DoRequest() {
Doc theDoc = new Doc();
theDoc.Rect.Inset(30, 30);
theDoc.Color.String = "255 255 255";
Random random = new Random();
int theID =
theDoc.AddImageUrl("http://www.websupergoo.com/support.htm?random="+random.Next());
while (theDoc.Chainable(theID)) {
theDoc.FrameRect();
theDoc.Page = theDoc.AddPage();
theID = theDoc.AddImageToChain(theID);
}
for (int i = 1; i <= theDoc.PageCount; i++) {
theDoc.PageNumber = i;
theDoc.Flatten();
}
context.Response.ContentType = "application/pdf";
context.Response.AddHeader("content-disposition", "attachment;
filename=MyPDF.PDF");
theDoc.Save(context.Response.OutputStream);
theDoc.Clear();
}
public bool IsReusable {
get {
return true;
}
}
}
<================================================>
directory structure:
/
pdfgen.ashx
web.config
bin/
ABCpdf.dll
ABDpdfCE6.dll
The web.config is minimal, probably not even needed:
<configuration>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
<trace enabled="true"/>
</system.web>
</configuration>
--
View this message in context: http://www.nabble.com/3rd-party-dlls---ABCpdf-tf3435030.html#a9578721
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list