Note that there are some explanatory texts on larger screens.

plurals
  1. POPrinting only the Image, embedded into an ASP.NET page
    primarykey
    data
    text
    <p>I am looking to print using C#, Microsoft Visual Studio, asp.net.</p> <p>The goal: I am trying to print all pages in a fax document.</p> <p>Format: The fax document is received as a single .tiff file with multiple pages.</p> <p>What needs to be done:- I need to iterate each page in the .tiff image and print them all.</p> <pre><code>// 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 &lt; number; i++) { string _FaxId = Page.Request["FaxId"]; _PageIndex = i; imgFax.ImageUrl = "ShowFax.ashx?n=" + _FaxId + "&amp;f=" + _PageIndex + "&amp;mw=750"; PrintAll.Attributes.Add("onclick", "return printing()"); } } </code></pre> <p>and In my Java script I have:</p> <pre><code>function printing() { window.print(); } </code></pre> <p>Now the issues are:</p> <ol> <li><p>The function only prints one page (the very last page of the tiff file)....and it prints the entire window and not just the embedded .tiff image in the entire web browser window.</p> <p>Any Ideas of how to go about just printing the .tiff embedded image instead of the entire web browser window.</p></li> <li><p>Although my for loop iterates through the pages. The print function is only called after the loop has iterated through all the pages and stopped on the final page (say page 6/6). And then it only prints that last page (along with the rest of the contents on the browser window). This is not what I want to happen... I dont want to print all the excess material on the browser window such as buttons, links etc... I just want the embedded .tiff image from the browser window.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload