【问题标题】:Pagewise text rendering in web application using asp.net and C#使用 asp.net 和 C# 在 Web 应用程序中呈现分页文本
【发布时间】:2010-10-20 01:14:52
【问题描述】:

嗨, 我有一个大的 html 格式的文本。我想在页面中显示文本(如在 MS Word 中)。有没有办法做到这一点?

【问题讨论】:

    标签: c# asp.net text-rendering


    【解决方案1】:

    最好的方法是在带有组件的 PDF 中呈现它(可以是 ABCPdf from WebSuperGoo 或其他解决方案)

    Doc theDoc = new Doc();
    theDoc.Rect.Inset(72, 144);
    theDoc.Page = theDoc.AddPage();
    int theID;
    theID = theDoc.AddImageUrl("http://www.yahoo.com/"); 
    while (true) {
      theDoc.FrameRect(); // add a black border
      if (!theDoc.Chainable(theID))
        break;
      theDoc.Page = theDoc.AddPage();
      theID = theDoc.AddImageToChain(theID);
    } 
    
    for (int i = 1; i <= theDoc.PageCount; i++) {
      theDoc.PageNumber = i;
      theDoc.Flatten();
    }
    
    theDoc.Save(Server.MapPath("pagedhtml.pdf"));
    theDoc.Clear(); 
    

    【讨论】:

      猜你喜欢
      • 2020-09-21
      • 2019-03-04
      • 2014-06-26
      • 2022-01-04
      • 2020-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-04
      相关资源
      最近更新 更多