public ActionResult GeneratePdf(int id)
{
var labelRepository = new LabelRepository();
var label = labelRepository.GetLabel(id);
if (String.IsNullOrEmpty(label.PDFLocation))
{
var action = Url.Content("~/Label/ViewPdf/" + id); //doc
Doc theDoc = new Doc();
string filename = Guid.NewGuid().ToString();
string path = Server.MapPath("~/" + filename + ".pdf");
theDoc.AddImageUrl("action");
theDoc.Save(path);
theDoc.Clear();
label.PDFLocation = path;
labelRepository.Save();
return base.File(path, "application/pdf");
}
else
{
return base.File(label.PDFLocation, "application/pdf");
}
}
这不会添加我的图像网址,所以我的PDF不会打开,所以我可以看到它。任何想法? -我的图片不会添加C#
您使用什么库来生成PDF? – RQDQ 2011-02-26 18:44:49
你是什么意思,它不会添加图片网址? – msarchet 2011-02-26 18:46:18
我正在使用ABCPdf – Samjus 2011-02-26 18:46:43