Hi All,
Just out of curiosity and a zeal to learn, I started out on making a small utility that would split a given PDF file into pages.
I did that successfully using iTextSharp, a free Open Source library for PDF generation.
Next step was to enhance this utility to read and merge different PDFs into one single unit based on any criteria given by the user.
After quite long I could finish that work and now the utility is ready with the following features:
1. Split PDF into single page PDF files.
2. Split based on criteria given by user.
3. Select multiple files to MERGE into one.
4. Merge files based on criteria by user.
Further to this, I had a look at another utility called PDFBox and I could read the elementary text out of the PDF as well.
So now we have a utility that has the power to Split / Merge or even read a PDF file into a text file/ text stream.
If anyone needs that please get in touch with me.
-- Ashutosh
Thursday, March 8, 2007
Friday, February 23, 2007
PDF Merging and Splitting
Working with my collegues on iText and seeing an application that wrote multiple PDF pages and created one document out of it, an idea clicked to me for writing an application that would merge multiple PDFs into one or even Splitt the single PDF into multiple files at will.
Currently I am done with the merging part and now the app merges the selected PDF files to generate single PDF with all the pDFs merged.
I am onto the second part: Splitting. I foresee myself completing the basic part in a day or two, i.e. it will take a single PDF and splitt it into multiple files with one page each (for ex- a PDF file with 10 pages will result in 10 PDF files with single page each.)
Now I am looking to make it more generic like you provide the resulting file name, location and each page in each file and the files are created on that basis.
Really Looking forward to it.
So wait and watch..................
--Ashutosh
Currently I am done with the merging part and now the app merges the selected PDF files to generate single PDF with all the pDFs merged.
I am onto the second part: Splitting. I foresee myself completing the basic part in a day or two, i.e. it will take a single PDF and splitt it into multiple files with one page each (for ex- a PDF file with 10 pages will result in 10 PDF files with single page each.)
Now I am looking to make it more generic like you provide the resulting file name, location and each page in each file and the files are created on that basis.
Really Looking forward to it.
So wait and watch..................
--Ashutosh
Wednesday, February 14, 2007
Year 2038 problem
The Year 2038 problem The Year 2000 problem is understood by most people these days because of the large amount of media attention it received. Most programs written in the C programming language are relatively immune to the Y2K problem, but suffer instead from the Year 2038 problem.
This problem arises because most C programs use a library of routines called the standard time library (time.h). This library establishes a standard 4-byte format for the storage of time values, and also provides a number of functions for converting, displaying and calculating time values.
The standard 4-byte format assumes that the beginning of time is January 1, 1970, at 12:00:00 a.m. This value is 0. Any time/date value is expressed as the number of seconds following that zero value. So the value 919642718 is 919,642,718 seconds past 12:00:00 a.m. on January 1, 1970, which is Sunday, February 21, 1999, at 16:18:38 Pacific time (U.S.). This is a convenient format because if you subtract any two values, what you get is a number of seconds that is the time difference between them. Then you can use other functions in the library to determine how many minutes/hours/days/months/years have passed between the two times. If you have read the Tech Touch on Bits and Bytes, you know that a signed 4-byte integer has a maximum value of 2,147,483,647, and this is where the Year 2038 problem comes from. The maximum value of time before it rolls over to a negative (and invalid) value is 2,147,483,647, which translates into January 19, 2038. On this date, any C programs that use the standard time library will start to have problems with date calculations. This problem is somewhat easier to fix than the Y2K problem on mainframes, fortunately. Well-written programs can simply be recompiled with a new version of the library that uses, for example, 8-byte values for the storage format. This is possible because the library encapsulates the whole time activity with its own time types and functions (unlike most mainframe programs, which did not standardize their date formats or calculations).
So the Year 2038 problem should not be nearly as hard to fix as the Y2K problem was. An alert reader was kind enough to point out that IBM PC hardware suffers from the Year 2116 problem. For a PC , the beginning of time starts at January 1, 1980, and increments by seconds in an unsigned 32-bit integer in a manner similar to UNIX time. By 2116, the integer overflows. Windows NT uses a 64-bit integer to track time. However, it uses 100 nanoseconds as its increment and the beginning of time is January 1, 1601, so NT suffers from the Year 2184 problem.
-- Ashutosh
This problem arises because most C programs use a library of routines called the standard time library (time.h). This library establishes a standard 4-byte format for the storage of time values, and also provides a number of functions for converting, displaying and calculating time values.
The standard 4-byte format assumes that the beginning of time is January 1, 1970, at 12:00:00 a.m. This value is 0. Any time/date value is expressed as the number of seconds following that zero value. So the value 919642718 is 919,642,718 seconds past 12:00:00 a.m. on January 1, 1970, which is Sunday, February 21, 1999, at 16:18:38 Pacific time (U.S.). This is a convenient format because if you subtract any two values, what you get is a number of seconds that is the time difference between them. Then you can use other functions in the library to determine how many minutes/hours/days/months/years have passed between the two times. If you have read the Tech Touch on Bits and Bytes, you know that a signed 4-byte integer has a maximum value of 2,147,483,647, and this is where the Year 2038 problem comes from. The maximum value of time before it rolls over to a negative (and invalid) value is 2,147,483,647, which translates into January 19, 2038. On this date, any C programs that use the standard time library will start to have problems with date calculations. This problem is somewhat easier to fix than the Y2K problem on mainframes, fortunately. Well-written programs can simply be recompiled with a new version of the library that uses, for example, 8-byte values for the storage format. This is possible because the library encapsulates the whole time activity with its own time types and functions (unlike most mainframe programs, which did not standardize their date formats or calculations).
So the Year 2038 problem should not be nearly as hard to fix as the Y2K problem was. An alert reader was kind enough to point out that IBM PC hardware suffers from the Year 2116 problem. For a PC , the beginning of time starts at January 1, 1980, and increments by seconds in an unsigned 32-bit integer in a manner similar to UNIX time. By 2116, the integer overflows. Windows NT uses a 64-bit integer to track time. However, it uses 100 nanoseconds as its increment and the beginning of time is January 1, 1601, so NT suffers from the Year 2184 problem.
-- Ashutosh
Friday, February 9, 2007
Strange Maxlength behaviour
Hi,
Okay another interesting issue. Anyone ever wondered about the MaxLength property of a textbox in .NET.
Yeah by default, the MaxLength is 0 and 0 obviously in this case means INFINITE stating you can put any number of characters in the textbox.
Theoritically its perfect but practically speaking, it never takes characters more than 32K
WHY....??
Okay to the extent I got to know about it, here is the reason.
TEXTBOX ---------object
TEXTBOX.TEXT ----------string
STRING.LENGTH -------- integer / int32
SO basically its the limitation of String Class and its length property (which is of Int32 type)
that limits the length of a textbox to type (Int32) and hence the reason for limitation of textbox maxlength.
--Ashutosh
Okay another interesting issue. Anyone ever wondered about the MaxLength property of a textbox in .NET.
Yeah by default, the MaxLength is 0 and 0 obviously in this case means INFINITE stating you can put any number of characters in the textbox.
Theoritically its perfect but practically speaking, it never takes characters more than 32K
WHY....??
Okay to the extent I got to know about it, here is the reason.
TEXTBOX ---------object
TEXTBOX.TEXT ----------string
STRING.LENGTH -------- integer / int32
SO basically its the limitation of String Class and its length property (which is of Int32 type)
that limits the length of a textbox to type (Int32) and hence the reason for limitation of textbox maxlength.
--Ashutosh
Monday, February 5, 2007
Creating a new form at runtime....
Hi all,
Yesterday while supporting user @ Experts-Exchange, I came across a question asking if I could create an instance of a new FORM at runtime and show it on the screen.
Well thinking at the first instance, looks quite straight forward. Theoritically its like creating a new instance of an object and using its methods and properties.
But practically its not as easy as with any other object. Theoritically the below code shows what exactly he wanted and its exactly what we can do in general coding with any other objects.
String strFormName = "Form1";
Form frmNew = (Form)(strFormName); //A new form with the name "Form1"
frmNew.Show();
So exploring through for the same at first hit it looked impossible and thats what I thought.
But then I was guided to an article on MSDN that explained using Activator.CreateInstance For all such tasks and it looked quite obvious.
Here's the code for it.
String strFormName = "Form1";
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Form frmNew = (Form)asm.CreateInstance(asm.Getname.name + "." + strFormname, true);
frmNew.Show();
Hope someday this would be of use to me as well ;-)
--Ashutosh
Yesterday while supporting user @ Experts-Exchange, I came across a question asking if I could create an instance of a new FORM at runtime and show it on the screen.
Well thinking at the first instance, looks quite straight forward. Theoritically its like creating a new instance of an object and using its methods and properties.
But practically its not as easy as with any other object. Theoritically the below code shows what exactly he wanted and its exactly what we can do in general coding with any other objects.
String strFormName = "Form1";
Form frmNew = (Form)(strFormName); //A new form with the name "Form1"
frmNew.Show();
So exploring through for the same at first hit it looked impossible and thats what I thought.
But then I was guided to an article on MSDN that explained using Activator.CreateInstance For all such tasks and it looked quite obvious.
Here's the code for it.
String strFormName = "Form1";
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Form frmNew = (Form)asm.CreateInstance(asm.Getname.name + "." + strFormname, true);
frmNew.Show();
Hope someday this would be of use to me as well ;-)
--Ashutosh
Monday, January 29, 2007
Hi all,
Here is a small doc for all who always wanted to know the Keyboard shortcuts for the general tasks in VS.NET IDE like commenting a code block, switching between the different views etc.
Download the doc from THIS link.
--Ashutosh
Here is a small doc for all who always wanted to know the Keyboard shortcuts for the general tasks in VS.NET IDE like commenting a code block, switching between the different views etc.
Download the doc from THIS link.
--Ashutosh
Wednesday, January 10, 2007
A new Task
Okay so I have been assigned first task at EITS and I am already feeling the difference between the level of working here and in Avinex.
I have been assigned the task to look at the prospects of implementing ECLIPSE IDE for Report development.
All these days, I have known ECLIPSE as an IDE for development of classes and writing code in JAVA. Just a user friendly interface for writing code and nothing much. But here while exploring, I realized its actually a lot more than that BUT SADLY FOR JAVA DEVELOPERS.
Apart from a mere few plugins for development with C/C++ and C# there is not much of a support in ECLIPSE for other languages. Still looking into the report designer for ECLIPSE.
The report designer has an Easy to use GUI for Rapid development of Reports and quick visualization of the same.
Best part is that the underlying code is all XML for this report and hence a universal structure. But the problem is the schema it uses for interpreting all HTML and SCRIPTING involved.
It literally dumps all the HTML and all expressions and evaluations that we add to the reports into this XML and then it basically kinda executes this XML while showing the report.
I am still looking at the prospects of using it in my Framework project, but at the moment there looks nothing much in it.
-- Ashutosh
I have been assigned the task to look at the prospects of implementing ECLIPSE IDE for Report development.
All these days, I have known ECLIPSE as an IDE for development of classes and writing code in JAVA. Just a user friendly interface for writing code and nothing much. But here while exploring, I realized its actually a lot more than that BUT SADLY FOR JAVA DEVELOPERS.
Apart from a mere few plugins for development with C/C++ and C# there is not much of a support in ECLIPSE for other languages. Still looking into the report designer for ECLIPSE.
The report designer has an Easy to use GUI for Rapid development of Reports and quick visualization of the same.
Best part is that the underlying code is all XML for this report and hence a universal structure. But the problem is the schema it uses for interpreting all HTML and SCRIPTING involved.
It literally dumps all the HTML and all expressions and evaluations that we add to the reports into this XML and then it basically kinda executes this XML while showing the report.
I am still looking at the prospects of using it in my Framework project, but at the moment there looks nothing much in it.
-- Ashutosh
Friday, December 29, 2006
strReverse in C#
Just came across this small piece of code while I was looking out to reverse a string in C# and soon discovered there was nothing like strReverse (in VB) in C#.
So obviously needed to look for an alternate. Got quite a few of them but this one looked quite nifty and sleek. Take a look
-- Ashutosh
So obviously needed to look for an alternate. Got quite a few of them but this one looked quite nifty and sleek. Take a look
private string StringReverse(string ToReverse)
{
Array arr = ToReverse.ToCharArray();
Array.Reverse( arr );// reverse the string
char[] c = (char[])arr;
byte[] b = System.Text.Encoding.Default.GetBytes(c);
return System.Text.Encoding.Default.GetString(b);
}
-- Ashutosh
Wednesday, December 6, 2006
My Links
HI,
Posting after a long time. Got a bit busy with my new house. The construction has started and am really looking forward to it.
BTW. This post wasn't meant for this, but I came across quite a few interesting topics within these days and decided to post them as a seperate post so that it could be expanded more and more to encorporate new links as and when they are found. Here are a few to start off:---------
1. Introduction to Object Oriented Programming - I
2. Introduction to Object Oriented Programming - II
3. Introduction to Object Oriented Programming - III
4. Introduction to Object Oriented Programming - IV
5. Introduction to Object Oriented Programming - V
6. Introduction to Object Oriented Programming - VI
7. Overview of Garbage Collection and IDisposable
8. Convert VB.NET Code to C# and Vice Versa
9. Best Practices For .NET Performance
10. Unions in C#
I would like people to post comments here regarding the links and would be thankful to people if they feel they could contribute to the same and provide me the links for such interesting articles.
-- Ashutosh
Posting after a long time. Got a bit busy with my new house. The construction has started and am really looking forward to it.
BTW. This post wasn't meant for this, but I came across quite a few interesting topics within these days and decided to post them as a seperate post so that it could be expanded more and more to encorporate new links as and when they are found. Here are a few to start off:---------
1. Introduction to Object Oriented Programming - I
2. Introduction to Object Oriented Programming - II
3. Introduction to Object Oriented Programming - III
4. Introduction to Object Oriented Programming - IV
5. Introduction to Object Oriented Programming - V
6. Introduction to Object Oriented Programming - VI
7. Overview of Garbage Collection and IDisposable
8. Convert VB.NET Code to C# and Vice Versa
9. Best Practices For .NET Performance
10. Unions in C#
I would like people to post comments here regarding the links and would be thankful to people if they feel they could contribute to the same and provide me the links for such interesting articles.
-- Ashutosh
Tuesday, December 5, 2006
A new beginning
Hi All,
Today I had a new beginning in my life when I stepped out of Avinex Software Pvt. Ltd. and stepped into eXtensible IT Solutions. Yes I switched my Job.
Well not so obviously, the key factor behind this change was not monetory. Yes believe me.....
I always wanted to grow. Grow in terms of technology, in terms of responsibility and also financially.
At Avinex, I had a few concerns of mine. Ever since I started programming in VB6.0, I wanted to take a dip into the world of C++ programming as well and with the advent of .NET, C# became my new affair.
Suddenly got the opportunity of being a part of a team which was bewing created for development of a product which was supposed to be working as a Middle Tier for a multi ties application AND THAT TOO IN C#. I saw this opportunity as a big one in terms of gaining a good knowledge of OO concepts as well as C#. So grabbed it with both hands.
Secondly at Avinex, I was suddenly finding myself looking straight into a glass ceiling where I could see opportunities of growth but which really were not there. This was getting on me.
And last but not the least, a raise of almost 10 grands a month is never like refusing.
Anyways thats an old story now.
The latest is that I am into eXtensible and am looking forward to a great time over there.
Cheers
--Ashutosh
Today I had a new beginning in my life when I stepped out of Avinex Software Pvt. Ltd. and stepped into eXtensible IT Solutions. Yes I switched my Job.
Well not so obviously, the key factor behind this change was not monetory. Yes believe me.....
I always wanted to grow. Grow in terms of technology, in terms of responsibility and also financially.
At Avinex, I had a few concerns of mine. Ever since I started programming in VB6.0, I wanted to take a dip into the world of C++ programming as well and with the advent of .NET, C# became my new affair.
Suddenly got the opportunity of being a part of a team which was bewing created for development of a product which was supposed to be working as a Middle Tier for a multi ties application AND THAT TOO IN C#. I saw this opportunity as a big one in terms of gaining a good knowledge of OO concepts as well as C#. So grabbed it with both hands.
Secondly at Avinex, I was suddenly finding myself looking straight into a glass ceiling where I could see opportunities of growth but which really were not there. This was getting on me.
And last but not the least, a raise of almost 10 grands a month is never like refusing.
Anyways thats an old story now.
The latest is that I am into eXtensible and am looking forward to a great time over there.
Cheers
--Ashutosh
Subscribe to:
Posts (Atom)