How to capture html to image on x64 windows

X64 windows is becoming more and more polular platform. Htmlsnapshot component has supported html to image on windows x64 platform along with the industry trend.

There are mainly four x64 windows: XP x64,  Vista X64, Windows 2003 x64, Windows 2008 X64.  The first two are client platform while the last two are server version.

To convert html to image on windows x64 platform, there are two ways:

1. Convert html to image with the 32 bit component. To do this, html to image function must run under a 32 bit process. By default, htmlsnapshot will register itself as 32 bit component on Windows X64/

For example, you can run the simple vbscript demo with 32 bit mode like this:

c:WindowsSysWOW64cscript.exe DemoVBScriptsimple.vbs

2. Convert html to image with native 64bit mode. Since IE has been ported to x64, so htmlsnapshot can capture html to image with 64 bit IE.  To do this, first you need to manual register the 64 bit htmlsnapshot. In the installation folder, run below command:

regsvr32 x64htmlsnap2.dll

Now, you can run the simple vbscript demo with 64bit mode like this:

c:Windowssystem32cscript.exe DemoVBScriptsimple.vbs

Another thing to notice is that in order to capture html page with flash to image, you has to use the 32 bit mode. The reason is that the flash player doesn’t have 64 bit version yet.  Adobe is still working on this. Please read:

http://kb.adobe.com/selfservice/viewContent.do?externalId=6b3af6c9&sliceId=2

How to run html2image linux on Ubuntu64

Here is detailed example on how to use html2image linux on Ubuntu 64 bit (Ubuntu 7.10 – the Gutsy Gibbon)

This serves as a good example on how to use html2image. Other 64 bit Linux distribution can be done similarly.

1. Install Ubuntu 64

2. Login into the server (you can use the text mode login here. This is suitable for headless server as well)

If you are in GUI mode, Ctrl+Alt+F2 will switch you to text mode.

3. Enter a folder, download html2image

wget http://www.guangmingsoft.net/htmlsnapshot/html2image.i386.tar.gz

4. Extract html2image

tar xvzf html2image.i386.tar.gz
cd html2image
export LD_LIBRARY_PATH=./

4. Install 32bit application support libraries.

sudo apt-get install ia32-libs

5. Install Xvfb coming with the Ubuntu

sudo apt-get install xvfb

6. Run Xvfb

Xvfb :1 -screen 0 640x480x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1
Of course, you could try high resolution like 1024x768x24

7. Now you can run html2image, it should work
./html2image www.google.com a.jpg

Check if the a.jpg is created successfully.

 

convert html to image with htmlsnapshot in php

Here are a more complete examples of using htmlsnapshot to convert html to image with php on Windows.

Note the following things:

1. You copy/paste the below code into test.php and run on command line

   php.exe test.php

 2. Yon can see it uses GetErrorCode to handle errors to make your code more robust.

<?php

$url = “http://google.com/“;
$path = “.\”;
$img = “1.jpg”;
$timg = “1s.jpg”;
$limg = “1b.jpg”;
$iimg = “1i.jpg”;

$com = new COM(“HTMLSNAP2.HtmlSnap.1″);
$com->SetTimeout(150000);
$com->SetDelayTime(5000);
$com->EnableActiveX(true);
$com->EnableJava(true);
$com->EnableScript(true);
$com->EnableActiveX(true);
$com->SetJPEGQuality(100);
$com->SetSmoothingMode(2);
$com->SetInterpolationMode(6);
$com->SnapUrl($url, $path.$img );

$err = $com->GetErrorCode();
if ($err == 1)
{

$com->SetClipRect(0, 0, 1024, 768);
$com->SaveImage($path.$iimg);

$com->GetThumbnailImage($path.$img, $path.$timg, 160, 120, 0);
$com->GetThumbnailImage($path.$img, $path.$limg, 320, 240, 0);
$com->Clear();

print “Snapshot of “.$url.”. Click to enlarge<br>”;
print “<a href=”.$iimg.” mce_href=”.$iimg.”><img src=”.$timg.” mce_src=”.$timg.”><img src=”.$limg.” mce_src=”.$limg.”></a><br/>”;
}
else
{
    print “error happens”;
}
 
?>

How to run an exe in coldfusion

Cold fusion is a CGI language like asp, php. Sometimes, you may need to call an external exe in coldfusion.

It is absolutely doable in coldfusion. For exmaple, if you want to call cscript.exe, here is what you can do:

<cfexecute name = “C:WindowsSystem32cscript.exe
  arguments = “pdfmerge.vbs  c:1.pdf|c:2.pdf  c:out.pdf”
  outputFile = “C:Tempoutput.txt”
  timeout = “100″>
</cfexecute>

A handy script to convert html to image

You may need to run a command line utility to convert html or url to image. Here is a handy script that converts url/html to image with our award winning htmlsnapshot product.

Save the below code into a script snapurl.vbs (Or you can find this script in htmlsnapshotdemovbscript)

set args = WScript.Arguments
num = args.Count

if num <> 2 then
   WScript.Echo “Usage: [CScript | WScript] snapurl.Vbs Url ImageFile”
   WScript.Quit 1
end if

‘demo how to convert html to image
Dim snap

‘Create the Html Snapshot Object
Set snap = CreateObject(“HTMLSNAP2.HtmlSnap.1″)
snap.SetCode “Input your license code here to remove watermark”
snap.SnapUrl args.Item(0), args.Item(1)
WScript.echo “Snap return:” & CStr(snap.GetErrorCode)

‘Free object
Set snap = Nothing

 After that, you can run on command line like below:

cscript.exe snapUrl.vbs www.google.com g.jpg
cscript.exe snapUrl.vbs file://c:1.html g.jpg

Disable debug build assertion warning in firefox

Firefox debug version has a lot of assertion warnings.

I felt confused that they are not got fixed even in latest version 3

A way to disable the warning is here:

When making a debug build of Firefox from the CVS trunk you get lots of warning boxes appearing when it runs. These warnings are about failed assert checks and can usually be ignored if you’re not working on that area directly.

To turn off these warnings you can set an environment variable on Windows as follows:

SET XPCOM_DEBUG_BREAK=warn
firefox -Profilemanager

On Linux, something like:

XPCOM_DEBUG_BREAK=warn ./firefox -ProfileManager

Ways of making money online

  1. Affiliate Review Website. Create a website that reviews affiliate products like make money online programs, web hosting services etc. Run it on WordPress and update it everyday with affiliate feeds or articles. How much you’ll make depends on how thick (amount of content) the website is.
  2. Product Fan Blog. Create a WordPress blog around a popular product and update everyday with news about the product. The iPhone is a good example of a hot product to choose. Traffic will be quite decent over time if the product/s have longevity.
  3. Auction websites. Create a website that is similar to eBay to allow users to sell and buy products from each other. You will generate income by monetizing through ads and drawing a commission through each sale. You might get some steady revenue if you sell high ticket products or go niche enough to get a loyal user base.
  4. Dating Websites. Dating websites are communities which allow users to register, chat with and meet other interested users. They can be easily setup with turnkey scripts although you’ll really need a customized template and some coding work done to make it competitive or attractive enough to get some users. Markus Frind is currently the biggest individual Adsense publisher and makes well over $10K a day from his free dating site, Plenty of Fish.
  5. Made for Adsense Websites. These are websites with a keyword domain and they come with a bunch of pre written articles around a specific topic. Examples of common topics include acne, cancer, health and finance. These are generally boring, low maintenance sites that are plastered with contextual ads. Incredibly easy to create using the WordPress platform.
  6. Affiliate Product Website. This is a salespage which sells an electronic product like an eBook. Create the product, buy an existing one or just get someone to do it. The main way to make money is to drive or buy traffic to your salespage and make money when they buy your eBook or opt into your email list. This is an easy way to generate some real income, especially if you are have a great niche product or am skilled in promoting your personal brand and salespage.
  7. Online Games/Arcade Sites. Get someone to develop an online game that is for members only and earn money by selling points, which allow users to unlock extra options within the game. Arcade sites are simply sites with a collection of flash or online games. They are monetized through display ads. Games can spread quickly if they are very well designed and appealing.
  8. Forums or Social Network. Pick a topic that is able to attract a decent amount of users and create a forum or social network. Income will not come quickly and a lot of work is needed to build the community. Create a blog on the same domain and use for promotional purposes. There is a potential to earn a good amount of money when the forum gets big or popular.
  9. Specialized Search Engines. Build a search tool that allows visitors find media of specific types. Include your adsense ads within the search pages. This sort of tools usually don’t do very well unless you provide additional value on top of search. Examples of things to add include ajax search, folksonomy and recommendation engines.
  10. Paid Membership Site. These are membership sites which provide ongoing educational lessons on a specific topic or offer a large archive of resources, along with a forum. An example of this is the Teaching Sells website. Members will pay a fixed fee every month to maintain their membership.
  11. Design/Coding Service Site. Create a website that offers customized logo or website design, alongside coding for PSD to XHTML, WordPress and Joomla. Hire freelance coders and designers and manage them. Pay them a portion of each sale and promote your website through blogs and webmaster forums.
  12. File Hosting Website. Set up a file host which allows users to upload and share their files online with other users. There’s a tremendous amount of competition in this niche so its very difficult to make some real money unless you innovate on features or market it well.
  13. Web Directories. A web directory provides listings for websites and makes money from both display advertising and sale of premium listings. Most of the work needs to be focused on marketing and branding the site. Niche directories with a good reputation might find it easier to make money.
  14. Online Web tool. This includes URL shorteners, spell checkers, picture editors, file converters and various webmaster tools (keyword volume, link popularity). Visitors will often return to your site to use these tools if they are comprehensive enough or if your site is well designed and genuinely useful.
  15. Proxies. Proxies are websites which allow a websurfer to not only surf anonymously but bypass certain filters which prevent one from viewing a site. They are popular with the Myspace crowd and will often require a dedicated server. There are many proxies on the market but they may be worth exploring. Income is largely passive.
  16. Commercial Template Sites. Basically this involves the creation of readymade website templates for sale. They can be bundled up into sales packages and traffic can be obtained through PPC advertising. If you’re not interested in producing original templates, you can run the site using affiliate feeds from the other more established template websites like Template Monster.

50 good wordpress plugin list

Manage WordPress Comments

  • Subscribe To Comments – Allows readers to recieve notifications of new comments that are posted to an entry.
  • WP AJAX Edit Comments – Allows users and admins to edit comments on a post inline using AJAX.
  • Get Recent Comments – displays excerpts of the most recent comments and/or trackbacks that have been posted to the articles in your blog.
  • Close Old Posts – Closes comments on old posts without any DB queries.
  • WP Grins – allows you to put clickable smilies on your post and comments forms.
  • WordPress Paged Comments – allows comment paging. Useful for those very popular blog entries receiving many comments.
  • Live Comment Preview – the simplest way to get live comment previews on your site.
  • Show Top Commentators – Encourage more discussion from your readers, by displaying their names and number of comments they have made recently to your sidebar.
  • WordPress Gravatar Plugin – outputs the gravatar based on the commenters email address.
  • MyAvatars – shows MyBlogLog’s avatars in your comments
  • Comment Relish – Sends a thank you e-mail to your first time commentators.
  • Favatars – displays the favicon associated with the commenter’s website.
  • Brian’s Threaded Comments – adds a ‘Reply to this comment’ link to every comment. Makes it easy for people to reply to comments and discuss better.
  • Dofollow – lets you remove the nofollow attribute from your comments.
  • OpenID Comments for WordPress – allows users to leave comments using their OpenID.
  • Extended Comment Options – allows you to switch comments and/or pings on or off for batches of existing posts.

Stop WordPress Spam

  • Akismet – intelligently blocks spam comments. Checks your comments against the Akismet web service to see if they are spam or not.
  • Spam Karma 2 (SK2) – is an anti-spam plugin for the WordPress meant to stop all forms of automated Blog spam effortlessly, while remaining as unobtrusive as possible to regular commenters.
  • Bad Behavior – is a set of PHP scripts which prevents spambots from accessing your site by analyzing their actual HTTP requests and comparing them to profiles from known spambots.
  • Math comment spam protection – Adds a math question to comments form to detect human input and block automated spambots.
  • WP-Contact Form with Spam Protection – creates a contact form on your blog, through which your readers can contact you easily.

Expert WordPress SEO

  • Google XML Sitemaps Generator – creates a sitemap of all articles on your WordPress blog. Helps Google and other search engines index every article you write.
  • Permalink Redirect – replies a 301 permanent redirect, if requested URI is different from entry’s (or archive’s) permalink. It is used to ensure that there is only one URL associated with each blog entry.
  • All in One SEO Pack – Optimizes your WordPress blog for Search Engines (Search Engine Optimization).
  • Head META Description – Insert HTML META description tags using post excerpts.
  • SEO Title Tag – Optimize your wordpress title tags for search engines. Mass edit the title tags of posts, pages, category pages, tag pages etc.
  • Enforce www. Preference – will help preserve your permalinks by enforcing your no-www or yes-www preference and will strip off index.php from the ends of URIs.
  • Optimal Title – allows you to have your blog name tacked on to the end of the page title instead of having it appear first.
  • Quick META Keywords – will automatically add META Keywords tags to every single post based on categories under which the article is categorized.

Easy WordPress Navigation

  • Related Posts – Returns a list of the related entries based on active/passive keyword matches. Increase pageviews by providing targeted related content.
  • WP-PageNavi – Adds a more advanced page navigation to WordPress, which is very useful for navigation on index and category pages.
  • Evermore – Abbreviate all posts when viewed on multiple post pages. Helpful to create expandable posts summaries in WordPress. Combine with Less that changes the (more…) link so it displays the entire post, not just the part after the “more”.
  • Random Redirect – Allows you to create a link to a random post on your blog. Lets readers browse in a StumbleUpon-like fashion.
  • Lightbox JS Plugin – used to overlay images on the current page into neat Javascript-powered overlay popups.
  • WordPress Mobile Edition – shows an interface designed for a mobile device when visitors come to your site on a mobile device.
  • Popularity Contest – keeps a count of your post, category and archive views, comments, trackbacks, etc. and uses them to determine which of your posts are most popular.
  • Extended Live Archive – implements a dynamic, AJAXified way of digging into the archives of a blog.
  • Landing Sites – When visitors is referred to your site from a search engine, it shows them related posts to their search on your blog.
  • Clean Archives – designed to display your archive listings in a clean and uniform fashion. It lists the Month / Year, the day of the month the article was published, the title of the article, and the number of comments that have been made on each article.
  • Custom Query String – set the number of posts (custom queries) for every single page on your website like categories, archives, or search results pages.
  • Feed List – very useful for adding other RSS feeds to your site.
  • Sidebar Widgets because it allows you to move things (widgets) around, in and out of your sidebar. Not required for WordPress 2.2 and above.
  • KB Advanced RSS Widget – a wordpress widget that gives you complete control over how RSS feeds are parsed for your sidebar.
  • Category Cloud Widget – Adds a sidebar widget to display the categories as a tag cloud.
  • Adhesive – lets you make the posts “sticky”, such that the posts will remain at the top of the page.
  • Permalinks Migration Plugin – safely change your permalink structure without breaking the old links to your website or affecting your search engine rankings.

Interactive WordPress Posts

  • Share This – lets your visitors to add your post to various social bookmarking sites, or send a link via e-mail to a friend.
  • Digg this – detects incoming links from Digg.com to your wordpress post and automatically display a link back to the digg post, for people to digg your story.
  • Delicious Cached++ – uses the built-in MagpieRSS engine functions to create a list of the latest bookmarks on a del.icio.us account, from its RSS feed, keeping the feed cached in the database.
  • WP-Notable – displays a series of icons below each post allowing your readers to easily submit you to many different social bookmarking and networking sites.
  • WP-Email – Allows people to recommend/send your WordPress blog’s post/page to a friend.
  • WP-PostRatings – Adds an AJAX rating system for your WordPress blog’s post/page.
  • EasyTube – allows you to easily embed YouTube and Google Videos using one simple tag.
  • Twitter Updater – automatically sends a Twitter status update to your Twitter account when you create, publish, or edit your WordPress post. More best Twitter plugins.

WordPress Admin Management Tools

  • WordPress Database Backup – On-demand backup of your WordPress database. Back up your blog today.
  • WP-cache – Very fast cache module. Survive a Digg traffic spike easily.
  • WP-Supercache – A modification of WP-Cache that produces static html files.
  • Batch Categories – Easily manage the mass categorization of posts that match various criteria. Power edit your categories.
  • podPress – adds lots of features designed to make WordPress the ideal platform for hosting a podcast.
  • TinyMCE Advanced – adds 16 plugins to TinyMCE, the WordPress wysiwyg editor. Adds over 40 new buttons to the toolbar, which is now two rows plus one hidden row.
  • Exec-PHP – allows php tags inside the content or excerpt of your posts and pages to be executed just as in usual PHP files.
  • WordPress Reporter – allows you to easily view your Google Analytics and Feedburner reports in your WordPress administration area.
  • WordPress.com Stats – Tracks views, post/page views, referrers, and clicks. Requires a WordPress.com API key.
  • WP Tiger Administration – Uses power of CSS2 to manipulate the functionality of the WordPress administration area
  • Admin Drop Down Menu – eliminates the need for this double clicking on the Admin screens by allowing you to see the second level menu just by placing your mouse over a main menu.
  • InstantUpgrade – provides is a easy and safe way to upgrade your WordPress automatically with a single click.
  • Maintenance Mode Plugin – Adds a splash page to your blog that lets visitors know your blog is down for maintenance. Logged in administrators get full access to the blog including the front-end.
  • Theme Test Drive – allows you to safely test drive any theme on your blog as an administrator, while visitors continue to see the default one.

Advertising on WordPress

  • Ad Rotator – Rotates Ads randomly from a specified text file.
  • AdSense-Deluxe – is a WordPress plugin offering advanced options for managing the automatic insertion of Google AdSense or Yahoo Publisher Network (YPN) ads to your WordPress posts. More Google Adsense WP plugins.
  • Buy Me a Beer – allows your readers to donate money to you via PayPal on pretext of buying a beer.
  • WordPress BankRoll – offers to help you cut out the middleman by allowing advertisers to buy reviews directly on your blog.

WordPress Blog Translation

Enhance WordPress RSS Feeds

  • Feedburner Feedsmith – Forwards all feed traffic to Feedburner while creating a randomized feed for Feedburner to pull from.
  • Simple Feed Copyright – adds a simple copyright notice to full text wordpress feeds.
  • Full Text Feed – Prevents WordPress 2.1+ from adding a more link to your website’s feed. Ensures you get full text feeds.
  • Add Related Posts to Your Feed – adds a list of Related Posts to your full text feed. Requires either UTW or Related Posts plugin installed and activated.
  • RSS Signature – allow the addition of a custom tagline, signature or copyright message to the wordpress generated rss feeds.

Random WordPress Stuff

  • Democracy – adds AJAX polling functionality to your WordPress blog.
  • flickrRSS – allows you to easily display Flickr photos on your weblog