2009-11-19 170 views

回答

2

讓我在你的意思我猜測打印JPG文件...:0)

如果你想有一個Web客戶端打印的JPG,你必須使用JavaScript。在html中是這樣的:

<a href="JavaScript:window.print();">Print this jpg</a> 

設置css,以便只打印頁面上的jpg。

如果您希望服務器做,那麼你需要的東西,如:

{ 
     PrintDocument doc = new PrintDocument(); 
     doc.PrintPage += new PrintPageEventHandler (doc_PrintPage); 
     doc.Print(); 
    } 

    void doc_PrintPage (object sender, PrintPageEventArgs e) 
    { 
     Graphics g = e.Graphics; 
     g.DrawImage (youImage, 0, 0); 
    } 
相關問題