TO THE NEW Blog PAGES

Grails

Handling Password Protected Pdf with PdfReader

In one of our grails project , we had to attach cover to Pdf file . But since some of pdf’s uploaded were password protected. To handle this scenario we added bouncyCastle.jar , so our version of iText was able to handle password protected pdf . And Then to check whether pdf is password protected […]

Technology

MySql : Publish results of a query to a text file

A while back I was trying to debug an error in our application logic. For that I had to analyze the results of a query This analysis was getting pretty tough to do on the command line. So, I tried to find a way to transfer the results of a query to a text file […]

Technology

JavaScript Profiling through Firebug’s Console API.

Sometimes we want to know which line of codes or methods in the JavaScript is taking time which slows up the page load. Many times our browser gets hanged due to the execution of JavaScript. Firebug allows us to profile the JavaScript. Following are the two methods that are used for profiling JavaScript: console.profile() console.profileEnd() […]

Grails

Image comparison

In one of our projects, we need to compare images which comes from various sources and remove the duplicate one. The below algo helps us to remove the duplicate images. boolean compareImage(String firstPhotoUrl, String secondPhotoUrl) { boolean result = true; BufferedImage bi1 = ImageIO.read(new URL(firstPhotoUrl)) BufferedImage bi2 = ImageIO.read(new URL(secondPhotoUrl)) int size1 = bi1.getData().getDataBuffer().size; int […]

Grails

Images rotation and div rotation by CSS Transforms

The CSS transform property allows developers to rotate, scale, and skew blocks of HTML via CSS. Although you can do the same thing with images in Photoshop or The GIMP, using CSS transforms allows developers to do the same thing with any HTML markup and allows users to select the text within the transformed object. […]

Umar
Umar
Read

Grails

QR Code on PDF Documents for Identification and Detection on Server Side

In one of our projects, we needed to include QR Code on the PDF documents, which were to be sent out to the user and the printed version was to be received back from them. Once the documents were received, we were going to scan each sheet into an image file and then, these files […]

GrailsTechnology

What is Google Web Optimization, How to use or apply it in your project?

Recently as part of POC, I need to apply the Google web optimizer on various parts of the page to determine which content user clicked to best and will be most effective in getting conversions. For this you need to keep track of the various conversions, but how? That’s where Google web optimizer come handy, providing […]

Grails

Using bindData in services

In one of my projects, I was working on rest calls, and one of the requirement was such that I had to pass the XML to service and then parse it and bind the relevant details to an instance of a domain object. In essence I had to call bindData in service after creating a […]

Sachin
Sachin
Read

Grails

Creating select tag with optgroup in Grails

Hi, In one of my projects i needed to create a select-input tag with OPTGROUP options. I searched a lot about it and found that g:select tag do not support OPTGROUP So to solve this problem, i created a simple optgroup tag using Html and grails taglib. I created a Map for the values to […]

Vishal Sahu
Vishal Sahu
Read

Grails

Sharing Session Information between WordPress and Grails using Cookies and base64 encoding

A scenario arose in one of our projects that we had to share some information between the grails application (which was taking care of dynamic content) and wordpress (which was used to maintain the static pages about the application). The information was the logged in user’s name so that we could display that on the […]

Grails

Unique closure on more than one field.

In one of my recent grails project, I had a requirement to get unique objects from a list based on more than one field. Now, this can be done by passing the list to closure unique. I had a list of dates of a couple of years, and what I needed was a unique combination […]

Technology

Creating Paged Media with Different Paged Modes Using CSS3

In one of our projects, we had to create PDF documents from HTML. The iText renderer was an excellent solution to do that. However, the tricky part was that the cover page had to be of portrait orientation and the rest of the document, of landscape orientation. After doing a fair share of searching on […]