如何在c#中使用scryber导出PDF格式的gridview数据?

时间:2014-12-12 05:40:04

标签: c# asp.net pdf-generation

这里我想将数据保存在数据库中,并且数据将显示在Gridview中。当我想按下按钮时,gridview数据将通过使用SCRYBER追加到PDF 这里我的代码只是如何显示简单的文本框数据(这里我不使用ITEXTSHARP)
amespaces。

protected void btn_Click(object sender, EventArgs e)
{
    PDFDocument doc = new PDFDocument();
    PDFPage page = new PDFPage();
    page.PaperSize = Scryber.PaperSize.A4;
    page.PaperOrientation = Scryber.PaperOrientation.Portrait;
    doc.Pages.Add(page);
    PDFImage img = new PDFImage();
    img.Source="img source";
    PDFLabel lbl = new PDFLabel();
    lbl.Text = "Name:";
    lbl.FontSize = 14;
    PDFTextLiteral tl = new PDFTextLiteral();
    tl.Text = txt1.Text;
    tl.FontSize = 14;
    page.Contents.Add(img);
    page.Contents.Add(lbl);
    page.Contents.Add(tl);
    doc.ProcessDocument(this.Response);
}

0 个答案:

没有答案