Categories
Article ASP.NET HTML/CSS PHP Programming

PDF Creation: wkhtmltopdf

In past I post about how good wkhtmltopdf is. I have used it for few of my projects. Really it is the cheapest [as it is open source and free] and powerful solution. But it is not the reason I love it. I love this because it is the Easiest solution available. Most of PDF library range few hundred dollars to start with. Then we learn through their call of function to draw Tables and add media content and text. But with wkhtmltopdf, all you need to do is simple create a HTML page, add CSS and Javascript (yup, it support jQuery’s document load function and other other load method of your favourite javascript library.)

I recently test jQuery load function as I need to write text as Arc, however I don’t want to use Image as image manipulation will generate a rectangle image and then placing it going to be problem. But with wkhtmltopdf, and it’s support for JavaScript it make my life easier. I use a cool ArcText js following a nice article/tutorial http://tympanus.net/codrops/2012/01/24/arctext-js-curving-text-with-css3-and-jquery/ .

And yes, I recently saw that develpoment of wkhtmltopdf has started again. So this is going to be very good for those who want easy and best solution for their application.

Categories
.NET ASP.NET C#.NET JQuery JSON VB.NET/VB

ASP.NET JavascriptSerializer for Array

I need to throw some database entry which are as simple as TIME, for this I got a string array in my ASP.NET code behind. I was throwing this String Array in JSON format after using JavascriptSerialize.Serialize method and it is making not so perfect Json script. I said it is not making perfect json because the expect result for me was something like this:

[“10:20″,”10:30″,”10:40”]

but it was returing something like

{“d”:”[\”10:20\”,\”10:30\”,\”10:40\”]”}

the difference is that it is converting the array in to string, however the ideal result can be

{“d”:[“10:20″,”10:30″,”10:40”]}

But we cannot change that functionality now, so what I realise we should use the eval function of javascript to make our Jquery or whatever JSON parse you are using. So my Jquery code looks like

….

success: function(data) {
var items = [];
$.each(data, function(ind, val) {
var myobject = eval(val);
$.each(myobject, function(i, v) {                   
items.push(‘<option value=”‘ + v + ‘”>’ + v+ ‘</option>’);
});
});
}

this convert the String to Javascript object using Eval function. Easy enough !!!

Categories
Article Blog: My thoughts Javascript

JavaScript: New Presentation

We all have experienced some cool effects while we do web surfing. Its Twitter, Facebook, Google, Windows Live website, whatever you name it, they all use great web interface easy and to the point user interaction. This all belongs to one unified solution Javascript. I have been using JS since I start web programming. I found working with Javascript is second best option after working on XNA Game framework. It wasn’t that good since start, but I really blame it on Jquery that it really make something which is good to something great. Recently I am using lot of Jquery modules and functions. This not only the presentation of our web work but it also reduce work to more organized way of coding.

However the JQuery is good in itself, but I realise that it depends on few things, and one of those is good HTML, if you are using Javascript especially with these libraries make sure you first validate your HTML. You don’t necessarily need to validate using HTML validator such as W3C validation, but a symmetric HTML is what you need. With Libraries like Jquery, I really wonder if we need Flash and Silverlight anymore ? Though I love to work on silverlight, never got a chance to use that in my project. But from Banner Flash to Jquery Banner, I opt for Jquery Banner, because they are simpler and faster to work. It took me 2 hrs to ingrate Paypal on HTML site, without making any new public page on site, as I just use Jquery Dialog to show the form and proceed with order. Client didn’t expect that and they are excited to get it that way. It make their money worth, and it ease out my work to make a form in template. which is indeed quite a work as compare to plain HTML form with no style at all.

If you are looking for web programming career, Javascript is must to learn with HTML. Without this if you want to be a programmer, then you won’t be. If you want any help on concept I am happy to help as it also help me learn more and more.

Categories
Javascript

Colorbox: Alternative for Lightbox

I have got lot of queries on my Lightbox + Videobox merge code. But over time I realize my merged code is not good enough as now with dynamic web, that code is limited. It is said to see such great software didn’t evolve much. But as a developer we cannot stop for one code and hence here is great alternative for virtually all sort of Lightbox effect for anything, It is called Colorbox (http://colorpowered.com/colorbox/). I used it so far to display, Tell a Friend form, Dynamic Form created based on User Input, a Cool Slideshow. Not much, but all looks great with its control using Jquery.

I am really a great fan of Jquery, it change the web developer’s life to make Great website out of Good websites. Long Live JQuery and ColorBox. Thanks for sharing it with us.