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
Ïà¹ØÎĵµ£º
ǰ̨½Å±¾µÄÔªËØ×Ô¶¯ÏÂÀÀ©Õ¹:
¾ßÌåÊǵ±Êó±ê·ÅÔÚÒ»¸öÔªËØÉÏʱ,Õâ¸öÔªËØÈç¹ûÏÔʾ²»È«,¾Í×Ô¶¯À©Õ¹,²¢ÇÒ²»»áÓ°ÏìÆäËüµÄÔªËØ.ÒÆ¿ªÊó±ê¸ÃÔªËØ×Ô¶¯»¹Ô³ÉÔÀ´µÄÑùʽ.
ÔÚCoding µÄ¹ý³ÌÖÐ,Ò»¸ö¿çBrowserµÄÎÊÌâÊÇ:
ÔÚÿһ´ÎÏÔʾ float divÇ° ......
תÔØ×Ô£ºhttp://virgos.javaeye.com/blog/611146
Ò»£®Ç°ÑÔ£º
XMLÊÇ΢Èí.NetÕ½ÂÔµÄÒ»¸öÖØÒª×é³É²¿·Ö£¬¶øÇÒËü¿ÉνÊÇXML Web·þÎñµÄ»ùʯ£¬ËùÒÔÕÆÎÕ.Net¿ò¼ÜϵÄXML¼¼Êõ×ÔÈ»ÏԵ÷dz£ÖØÒªÁË¡£±¾ÎĽ«Ö¸µ¼´ó¼ÒÈçºÎÔËÓÃC#ÓïÑÔÍê³É.Net¿ò¼ÜϵÄXMLÎĵµµÄ¶Áд²Ù×÷¡£Ê×ÏÈ£¬ÎÒ»áÏò´ó¼Ò½éÉÜ.Net¿ò¼ÜÖÐÓëXMLÏà¹ØµÄÃüÃû¿Õ¼äºÍÆäÖеÄÖØÒªÀ ......
×î½üÒª¸Äдһ¸öºËÐļÓÃÜÈÏÖ¤À࣬´ÓC#¸Äд³ÉJava¡£
·¢ÏÖÔÚµ÷ÊÔʱ£¬¼ÓÃܵÄÊý¾ÝÎÞÂÛÈçºÎÒ²¶Ô²»ÉÏ¡£
¾¹ý¸ú×Ù£¬·¢ÏÖÎÊÌâ³öÔÚC#ºÍJava byteÀàÐ͵ÄÇø±ðÉÏ£ºÔÚC#Àï byteÀàÐÍÊÇÎÞ·ûºÅµÄ£¬¶øJavaÀïÊÇÓзûºÅµÄ£¬ËùÒÔC#ÀïµÄ129µ½JavaÀï¾Í³ÉÁ˸ºÊý¡£
·¢ÏÖÁËÎÊÌ⣬½â¾ö¾Í±È½ÏÈÝÒ×ÁË£¬Õë¶ÔJavaµÄbyte£¬²ÉÓÃIntÀ´½øÐд洢¡£
ͨ¹ýÈçÏ´ú ......
C# Delphi´¦Àí·ÖÎöQQÐÒé
¡¡´ó¼Ò˵µ½QQÐÒ鶼¾õµÃºÜÉñÃØ£¬ÊÇÒòΪQQ²»ÏñMSN»òÕßICQÐÒ鶼ÒѾ¹Ù·½¹«²¼ÁË£¬¶øQQµÄûÓй«²¼¡£Ñо¿ËüµÄÈËÒ²²»ÊÇÌرðµÄ¶à£¬ËäÈ»ÒѾÓÐÁË»ùÓÚ QQÐÒéËùд³ÉµÄµÚÈý·½Èí¼þ foicq, qq plugins for gaim, LumaQQ£¬µ«ÊÇÓÉÓÚËûÃÇÊÇ»ùÓÚ¶þ½øÖÆStreamµÄÐÒé¹ýÓÚ¸´ÔÓ£¬´ó¼ÒÔĶÁ´úÂëÒ²ÓÐÒ ......
Steve Jobs ÔÚ"Thoughts on Flash"Ò»ÎÄÖУ¬Ì¸¼°ÍøÂçÓ°Òôʱ£¬¶à´ÎÌáµ½HTML5ÓëH.264Á½Ïî±ê×¼¡£µ«ÊÇ£¬µ½µ×HTML5ÊÇʲô?FlashºÍH.264ÓÖÊÇʲô»ØÊÂ?ËùÒÔ£¬±¾ÎÄÖ¼ÔÚ½âÊÍËüÃÇÖ®¼äµÄ¹Øϵ£¬Èôó¼Ò¿ÉÒÔ³õ²½Á˽⡣
¡¡¡¡Ê×ÏÈ£¬ÒýÓÃSteve JobsµÄÒ»¶Î»°£º
¡¡¡¡AdobeÒ»ÔÙ·´¸´Ðû³ÆAppleµÄÒƶ¯É豸²»ÄÜÌṩ"ÍêÕû ......