Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

HTMLתPDF£¨C# itextsharp£©

Ò»¡¢ ÐèÇ󣺽«HTMLתPDF´òÓ¡¡£WebÏîÄ¿ÖÐ×ÜÊÇÓÐÕâÑùµÄÐèÇ󣬺ÜÊÇÈÃÈË¿àÄÕ¡£
¶þ¡¢ ·ÖÎö£ºÈçºÎÍê³ÉÕâ¸ö¹¤×÷£¿
1¡¢ ÐèÒª½âÎöHTML£¬È»ºóÀûÓÃitextsharp»æÖÆpdfÎĵµ¡£½âÎöHTMLÊÇÒ»¸öºÜÄÑÍê³ÉµÄÈÎÎñ£¬¸÷¸öä¯ÀÀÆ÷¶ÔHTMLµÄ½âÎöÎ廨°ËÞÍÖªµÀÕâ²»ºÃ½â¾ö¡£ÕâÌõ·²»ºÃ×ߣ¬µ«Ò²ÊÇ¿ÉÒÔÍê³ÉµÄ£¬Í¨¹ýwebbrowserÀà¿ÉÒÔ½âÎöHTML»ñÈ¡¸÷¶ÔÏóµÄλÖã¬È»ºó»æÖƵ½pdfÖС£·½·¨ÊÇ¿ÉÐУ¬ÆäÖеĸ´ÔӶȲ»Ð¡¡£
2¡¢ ½«HTML±£´æΪͼƬ£¬È»ºó²åÈëµ½pdfÎĵµÖУ¬ÕâÀォ½éÉÜÕâÖÖ·½·¨¡£ËæÖ®¶øÀ´µÄÎÊÌ⣺ÈçºÎ½«HTML±£´æΪͼƬÄØ£¿
Èý¡¢ ½â¾ö°ì·¨£º
1¡¢ ½«HTML±£´æΪͼƬ£ºÐèÒªÓõ½webbrowerÀ࣬½«Ö¸¶¨µÄHTMLÔØÈëwebbrower£¬È»ºóµ÷ÓÃÆäDrawToBitmap·½·¨»ñȡͼƬ¡£´úÂëÈçÏ£º
private System.Drawing.Bitmap bitmap;
    private string url;
    private int w = 760, h = 900;//A4Ö½ÕŶÔÓ¦µÄ·Ö±æÂÊ´ó¸Å¾ÍÊÇ760*900
    public void setBitmap()
    {
        using (WebBrowser wb = new WebBrowser())
        {
            wb.Width = w;
            wb.Height = h;
            wb.ScrollBarsEnabled = false;
            wb.Navigate(url);
            //È·±£Ò³Ãæ±»½âÎöÍêÈ«
            while (wb.ReadyState != WebBrowserReadyState.Complete)
            {
                System.Windows.Forms.Application.DoEvents();
            }
            bitmap = new System.Drawing.Bitmap(w, h);
            wb.DrawToBitmap(bitmap, new


Ïà¹ØÎĵµ£º

coolite control add the html tag

I always consider the coolitm control only can use its control tag in its body.
But I found that it can use html tag ,this very good.
so I show the sample to other:
<ext:Window
ID="Window1"
runat="server"
Width="500"
Height="485"
......

½«htmlÉú³Épdf

1.wkhtmltopdf      http://code.google.com/p/wkhtmltopdf/downloads/list
ÈçlinuÏÂÔØwkhtmltopdf-0.9.6-static-i386.tar.bz2
2.   tar -jxvf wkhtmltopdf-0.9.6-static-i386.tar.bz2 
3¡£ÖØÃüÃû mv  wkhtmltopdf-i386   wkhtmltopdf
4.²âÊÔÉú³Épdf   ./wkhtm ......

C# Delphi´¦Àí·ÖÎöQQЭÒé


C# Delphi´¦Àí·ÖÎöQQЭÒé
 
 
¡¡´ó¼Ò˵µ½QQЭÒ鶼¾õµÃºÜÉñÃØ£¬ÊÇÒòΪQQ²»ÏñMSN»òÕßICQЭÒ鶼ÒѾ­¹Ù·½¹«²¼ÁË£¬¶øQQµÄûÓй«²¼¡£Ñо¿ËüµÄÈËÒ²²»ÊÇÌرðµÄ¶à£¬ËäÈ»ÒѾ­ÓÐÁË»ùÓÚ QQЭÒéËùд³ÉµÄµÚÈý·½Èí¼þ foicq, qq plugins for gaim, LumaQQ£¬µ«ÊÇÓÉÓÚËûÃÇÊÇ»ùÓÚ¶þ½øÖÆStreamµÄЭÒé¹ýÓÚ¸´ÔÓ£¬´ó¼ÒÔĶÁ´úÂëÒ²ÓÐÒ ......

html ±íµ¥Ìá½»µÄÁ½ÖÖ·½·¨µÄÇø±ð post get

<form action="#" method="get">ÕâÀïÊÇ±íµ¥µÄÄÚÈÝ</form>
<form action="#" method="post">ÕâÀïÊÇ±íµ¥µÄÄÚÈÝ</form>
ÊôÐÔ"action",ÀïÃæÉèÖõÄÊÇ±íµ¥Ìá½»µÄ·¾¶.Ò»¸ö¶ÔÏó,°×»°ÎĵĽâÊÍ:±íµ¥½»¸øÁËË­.
ÊôÐÔ"method",ÀïÃæÉèÖõÄÊÂ±íµ¥Ìá½»µÄ·½Ê½,Ò»ÖÖ·½·¨,°×»°ÎĽâÊÍ:ÒªÔõÑùÌá½»Õâ¸ö±íµ¥,ÊÇÎÒÖ±½Óà ......

html css ±í¸ñ±ß¿ò

<html>
<head>
<mce:style type = "text/css"><!--
table
{
border-collapse:collapse;
}
td
{
border:solid 1px black;
}

--></mce:style><style type = "text/css" mce_bogus="1">table
{
border-collapse:collapse;
}
td
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ