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
Ïà¹ØÎĵµ£º
C#Á¬½ÓÁ¬½ÓAccess
Ê×ÏÈ¿´Ò»¸öÀý×Ó´úÂëÆ¬¶Ï:
³ÌÐò´úÂë:
--------------------------------------------------------------------------------
using System.Data;
using System.Data.OleDb;
......
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:\BegASPNET\Northwin ......
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ÐÒé
¡¡´ó¼Ò˵µ½QQÐÒé¶¼¾õµÃºÜÉñÃØ£¬ÊÇÒòΪQQ²»ÏñMSN»òÕßICQÐÒé¶¼ÒѾ¹Ù·½¹«²¼ÁË£¬¶øQQµÄûÓй«²¼¡£Ñо¿ËüµÄÈËÒ²²»ÊÇÌØ±ðµÄ¶à£¬ËäÈ»ÒѾÓÐÁË»ùÓÚ QQÐÒéËùд³ÉµÄµÚÈý·½Èí¼þ foicq, qq plugins for gaim, LumaQQ£¬µ«ÊÇÓÉÓÚËûÃÇÊÇ»ùÓÚ¶þ½øÖÆStreamµÄÐÒé¹ýÓÚ¸´ÔÓ£¬´ó¼ÒÔĶÁ´úÂëÒ²ÓÐÒ ......
<form action="#" method="get">ÕâÀïÊÇ±íµ¥µÄÄÚÈÝ</form>
<form action="#" method="post">ÕâÀïÊÇ±íµ¥µÄÄÚÈÝ</form>
ÊôÐÔ"action",ÀïÃæÉèÖõÄÊÇ±íµ¥Ìá½»µÄ·¾¶.Ò»¸ö¶ÔÏó,°×»°ÎĵĽâÊÍ:±íµ¥½»¸øÁËË.
ÊôÐÔ"method",ÀïÃæÉèÖõÄÊÂ±íµ¥Ìá½»µÄ·½Ê½,Ò»ÖÖ·½·¨,°×»°ÎĽâÊÍ:ÒªÔõÑùÌá½»Õâ¸ö±íµ¥,ÊÇÎÒÖ±½Óà ......
ÏëÔÚflexÖÐÕæÊµµÄÏÔʾhtml,µ«ÊÇtexteara,lable,textÖÐÖ»Ö§³Ö²¿·Öhtml±êÇ©
<a>¡¢<b>¡¢<br>¡¢<font>¡¢<img>Èç¹ûÓÃimgÓÖ´æÔÚÏÔʾ×Ô¶¯»»ÐеÄÎÊÌâ¡£Ö»ÓвÉÓÃǶÈëhtmlµÄ·½·¨À´½â¾ö¡£
1.flexdemo1
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe ......