Merge pdf files using C#

Written by jf on October 3, 2008 – 8:00 pm -

Recently I had to create an assembly component using C# to merge multiple PDF files into one file. The specification was pretty straight forward:
1) Merge two of more PDF document into a single output PDF File.
2) Used on an ASP.NET Page

After a few minutes of GOOG, I came up to this “ITextSharp

iText# (iTextSharp) is a port of the iText open source java library written entirely in C# for the .NET platform. iText# is a library that allows you to generate PDF files on the fly. It is implemented as an assembly.

It must be noted that the assembly is coded and compiled using the .NET Framework 1.1. You might want to migrate to the version 2.0 or 3.5 of the .NET Framework.

With a some more research on PDF merging. I was able to create a class that will make use of the ITextSharp assembly and perform as the merge pdf operation as needed.

Here is the code:
Read more »

Subscribe to my RSS feed

IIS Log Archiving

Written by jf on June 24, 2008 – 9:58 am -

You need to archive your IIS Log often so as not to get your log folder full with HTTP Logs.

I have been searching for some quick implemented solutions for performing this IIS Log archiving task and found some quiet nice discussions and article about it. Here are the links to the different post and forums that talk about a solution to solve this issue:

http://blogs.thesitedoctor.co.uk/tim/2007/02/10/Automatically+Delete+Old+IIS+Log+Files.aspx

http://www.iislogs.com/ (Tool to automate maintenance of IIS Log)

http://forums.webhostautomation.com/showthread.php?t=5053

http://forums.iis.net/p/1022450/1388469.aspx

On my side i need something with a bit more functionality so, i modified some of the scripts that i could find on the different article related above and came up with a solution that can.

  • Compress each log file found in your websites folder
  • FTP the compressed files on a foreign server ( Keeping historic of your IIS log ) Uses Chillkat Free FTP ActiveX
  • Delete them from your disk afterward

You can launch this process everyday and there will be no log that is older than a specified number of days on your server.

Requirement for this solution to work:

You can download the script here.

See the entire script in the full post.

Read more »

Subscribe to my RSS feed

Virtualization using VirtualBox

Written by jf on June 6, 2008 – 6:00 am -

Microsoft Virtual PC, which is a quiet efficient tool but needs licences to work with. Today while browsing the web i came to get accross a free open source alternative: VirtualBox

I installed it, had a copy of Linux Ubuntu and created it new virtual guest OS, it took me about 1 hour to set everything up.
From VirtualBox website:

VirtualBox is a family of powerful x86 virtualization products for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL). See “About VirtualBox” for an introduction.

Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows 3.x, Linux (2.4 and 2.6), and OpenBSD.

VirtualBox is being actively developed with frequent releases and has an ever growing list of features, supported guest operating systems and platforms it runs on. VirtualBox is a community effort backed by a dedicated company: everyone is encouraged to contribute while Sun ensures the product always meets professional quality criteria.

That said, I seriously encourage any developer, who needs Virtual OS to run, to either to make a development platform or doing test.

Here are some screen shots of running Windows XP and Ubuntu Linux.

Subscribe to my RSS feed

The 30 skills every IT person should have

Written by jf on June 4, 2008 – 6:00 am -

I found this article on infoworld.com it was written by Richard Casselberry. Here are some of them you can read the rest of the article here.

1. Be able to fix basic PC issues. These can be how to map a printer, back up files, or add a network card. You don’t need to be an expert and understand how to overclock a CPU or hack the registry, but if you work in IT, people expect you to be able to do some things.

[ If you have IT staffers who aren't up to snuff, fire them. Learn how to do it right. ]

2. Work the help desk. Everyone, from the CIO to the senior architect, should be able to sit down at the help desk and answer the phones. Not only will you gain a new appreciation for the folks on the phones, but you will also teach them more about your process and avoid escalations in the future.

3. Do public speaking. At least once, you should present a topic to your peers. It can be as simple as a five-minute tutorial on how IM works, but being able to explain something and being comfortable enough to talk in front of a crowd is a skill you need to have. If you are nervous, partner with someone who is good at it, or do a roundtable. This way, if you get flustered, someone is there to cover for you.

4. Train someone. The best way to learn is to teach.

5. Listen more than you speak. I very rarely say something I didn’t already know, but I often hear other people say things and think, “Darn, I wish I knew that last week.”

Read more…

Subscribe to my RSS feed

Freelancing, Online jobs for professionals

Written by jf on June 2, 2008 – 6:00 am -

Nowadays many professionals in different activity sector offers their services and expertise through freelance portals. These portals are websites were you can post job offerings and register as a freelance to take job offerings. In terms of business, you can bargain and get the work done at an affordable price with expert professionals.

So where is the catch ? Why doesn’t everyone go online and work as a freelancer ?

It’s quiet simple, before getting a Job online it can take quiet a while you must register to several websites either paid or non paid, then apply for job positions that fits your expertise, wait for an answer and if you are accepted start working. When working as a freelancer you are not bound by any long term contract many a time, you get to work on a module for 1 month and when the job is done, you simply have to get to the entire process again, which can sometimes take several weeks before you get another job. So being a freelance is a tedious and long process, but it is quiet a remunerative process, since you get to work on different project and gain much more experience.

Since I have expertise in Web Technology and Programming here are some websites that i am registered to.

Guru.com

Guru.com Logo Guru.com was launched August 2000 (as A2Zmoonlighter.com)
It’s Mission: To provide the most efficient platform to connect and perform transactions with freelance professionals locally, nationally, and globally.

Guru.com Baseline

Odesk.com

odesk logo Odesk.com was created in 2003
It’s Mission: Build the world’s best network of technology service providers through screening, testing, and feedback
Offer the platform that lets buyers successfully hire, manage, and pay service providers from around the world

odesk platform

thecodingmachine.com

The Coding Machine Logo thecodingmachine.com was launched in late 2006
It’s Mission: offers you IT services. Thanks to a new approach, your projects can be delivered quicker and at lower cost.
Has created a web platform and linked together coders from all over the world.

There are many for website offering job posting and freelance work but, there are a the one i experienced with and i find them pretty good tools to deal with when you are searching for a job online to share your expertise.

Leave your comment on other sites that might be good, I’ll review them and update this post.

Subscribe to my RSS feed

Exception: Collection was modified; enumeration operation may not execute.

Written by jf on May 28, 2008 – 7:00 am -

It’s been a while that i didn’t get this Exception, while working, and yesterday, while I was performing some test on  a new module that I implemented i got this exception. I knew i did get it sometimes back last year, and managed to solve it. So here is one solution when you are dealing with this kind of issue:

IList<Product> productList = new List<Product>();
productList.Add(new Product("Some product 1");
productList.Add(new Product("Some product 2");
productList.Add(new Product("Some product 3");
productList.Add(new Product("Some product 4");

for(int i=(productList.Count -1); i >= 0; i--)
{
//Perform Edit, Update, Delete Operation using for .. i loop in reverse order
}

There is a list of other solutions that can be found on the following websites:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=372532&SiteID=1
http://forums.asp.net/p/1147145/1861164.aspx
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21585534.html

Subscribe to my RSS feed

IT Workers gaining weigh and possible health problem

Written by jf on May 23, 2008 – 6:00 am -

I’ve just found a nice article that talks of a study performed by CareerBuilder.com, it talks about how IT workers have begun to gain weigh just by sitting all day in front of their computers :). Let’s just hear what they have to say.

Here is a little intro:

Feeling a little, shall we say, sluggish lately? You might be among the vast ranks of IT workers who have put on some extra heft while sitting at their desks.

A study by CareerBuilder.com found that half of U.S. IT workers have gained weight at their current jobs.

The study, which polled nearly 7,700 participants from Feb. 11 through March 13, found that 34 percent of IT workers report they have gained more than 10 pounds in their current positions. Even more alarming, 17 percent say they have put on more than 20 pounds!…

Read the full article on: IT Workers Weigh In on Health Habits

Subscribe to my RSS feed

Padding is invalid and cannot be removed.

Written by jf on January 18, 2008 – 4:32 pm -

Stop Google crawling WebResource.axd & ScriptResource.axd
As an ASP.NET developer i often get error message: “Padding is invalid and cannot be removed”. It’s a pretty annoying message that i have been trying to get rid of for days. It was caused by Google trying to index, crawl my WebResource.axd and session. But when the session expires you get this error message. Since Google caches the pages it visits the session on this page has already expired after it is crawled, when it tries to crawl the page again and request the WebResource.axd or ScriptResource.axd with an old key, an exception is raised.

Therefore to solve this problem the simple solution for that is to modify your robots.txt file in your root directory

and add the following at the end

Disallow: /ScriptResource.axd
Disallow:/WebResource.axd

With this no more issues regarding invalid padding.

If this does not solve your issue you can take a look at what other users propose here.

Some update on this issue, i found out while googling some days back:

On this post you can find out how to compress the webresource.axd and also somewhere in between prevent this error to occur.
http://mironabramson.com/blog/post/2007/10/New–Shiny–WebResourceaxd-compression-Module.aspx

Use the tool found at the website below to generate a machine key and a decryption key:
http://www.orcsweb.com/articles/aspnetmachinekey.aspx

Subscribe to my RSS feed

Vinivi, the Team

Written by jf on October 27, 2007 – 9:20 am -

Goodbye are always sad, but last week we made a little party for the departure of Noelette from the Vinivi Team. here is a small video introducing all the members of the team.

[kml_flashembed movie="Vinvi the Team" width="425" height="335" wmode="transparent" /]

Subscribe to my RSS feed

Time for change !!! new wordpress theme

Written by jf on October 25, 2007 – 9:25 pm -

It’s been while since i last wrote something on my blog, and also make some changes, these last month have been quiet busy. I first step to get back to the blogging community is to get a lighter look for my blog, and start writing some more post. :) since i have been doing many interesting things lately.

So how does my new theme look like ? ( I still have to make some changes thought to accept some ads and so on )

Subscribe to my RSS feed