【问题标题】:How can I create image tags?如何创建图像标签?
【发布时间】:2012-09-28 18:50:58
【问题描述】:

我有以下功能,可以让我遍历多页单 tiff 文件中的每一页。

// This function will iterate all pages, one at a time. //

 protected void PrintAll_Click(object sender, EventArgs e)
 {
    // counts number of pages in the fax document.//
    int number = _FaxPages.Count;

    // for loop to iterate through each page. //
    for (int i = 0; i < number; i++)
    {
        string _FaxId = Page.Request["FaxId"];

        _PageIndex = i;

        imgFax.ImageUrl = "ShowFax.ashx?n=" + _FaxId + "&f=" + _PageIndex + "&mw=750";

        PrintAll.Attributes.Add("onclick", "return printing()");             
    }
}

我想知道如何在 for 循环中动态创建单独的图像标签...这样我就可以使用这些图像打印 tiff 文件中的所有页面。

现在如果我在我的 javascript 中使用 window.print().. 它会打印整个网页以及按钮、链接、文本框、复选框等。我只需要能够打印里面的图像传真文档,它是具有多页(帧)的单个 TIFF 文件。

请帮忙。

【问题讨论】:

  • 如果您有一个网页,从该页面中提取所有图像会更容易,然后加载一个带有这些提取图像的新页面,并在该新页面上调用window.print()
  • 你能告诉我一些如何做到这一点的代码吗?请

标签: c# asp.net image printing tiff


【解决方案1】:

您应该创建一个用于打印的备用样式表。

<link rel="stylesheet" href="print.css" type="text/css" media="print" />

在您的情况下,您可以隐藏所有元素并仅显示img 标签。这看起来很具体,所以可以创建一个 print.fax.css 并仅在此页面上使用它。

【讨论】:

    猜你喜欢
    • 2011-05-25
    • 2018-06-13
    • 1970-01-01
    • 2021-02-02
    • 2020-01-12
    • 1970-01-01
    • 2014-03-22
    • 2021-06-08
    相关资源
    最近更新 更多