Blog Archives

Generating Web Page to PDF

Background:

Easiest, simplest, fastest and of course free way to generate PDF or images for web pages:

– Tool is named as “wkhtmltopdf” and “wkhtmltoimage”
– Both are in exe format.
– Written in C++ and also its source is open and licensed under open source.
– Because it is an exe, we can use this tool in both windows and web applications. And it is in C++  so it can be used for windows platform as well as in Linux based systems.

In Details:

I will be explaining how to use it in web applications to generate PDF and push that PDF to client. Rest can be taken care by considering this as an example.
You can download the exe from  https://code.google.com/p/wkhtmltopdf/downloads/list. And trust me this is really cool kit as it provides a lot of flexibility to hide or extend the content of the page in nearly every manner.
Read the rest of this entry

Basic points that can help to Improve Web Application Performance

1. Disable View State Of A Page If Possible:
Page that does not require any post back events can have the view State off. By default the “ViewState” property is enabled, we can disable it in two ways:
(a) At control level: by set EnableViewState property to false
(b) At page level: using <%@ Page EnableViewState=”false” %>

Advantage: It decreases the memory allocation on server.

2. Use of String Builder For Concatenation:
All operations we do on strings are stored in memory as separate references. When we modify our string, at run time it returns a new string, leaving the previous string as garbage collected. To stop creation of new references we should use string builder whenever concatenation is required.

Read the rest of this entry

%d bloggers like this: