Wednesday, 16 February 2011

W3C Validator Compliancy for Microsoft Office Live Web-Hosting and Facebook Buttons

(For the latest PDF files Merger Software please have a look at the top of the left margin, inside the red box.) I already had some of my experiences with Microsoft Office Live (OL) web hosting, which came useful for some of the visitors of this Blog. Recently my daughter had a look at my website with her FireFox browser and noticed that some pages of my site was not much readable from non-IE browsers. That gave me the idea that I should make my site standard based on the WWW authority criteria. I already had used the generic ASP template of OL, but with the loading of my designed pages from Documents Gallery of OL rather than the root directory. That makes the custom design more practicable. I can keep a couple of pages or even only one page in the root and the remaining pages of my site in the OL Document Gallery. (Even if you had an Apache server as your own personal host you would do that. This makes migration and other tweaking easier, too) Yet, using a note-pad for design meant no way of controlling it for the errors and we know that browsers are robust entities that interpret and run any design without much taking heed to errors or informing us about them. To control the errors I needed an intelligent IDE for design of pages. There are few free IDE's available, including Microsoft Visual Express Studio (now version 2010). I preferred to use NetBeans (NB) IDE latest version. Both IDE's have intelligent interfaces with capability to suggesting a list of possible codes and showing errors. NB shows mis-spelled words too. Hence, I opened one of pages with that IDE. Lo, and behold! All the lines were underlined with red as the error laden codes. Tables were not nested properly, tags were not furbished with correct way of tag-ending. Tags were used in wrong positions. Some tags and attributes were deprecated. A mixture of capital and lower cases were used for some tags. But the most important I found was the "Standard" that you declare at the top of the document from the W3C source. Some people have got the wrong idea that if you declare, say, two standards as HTML 4.01 and XHTML 1.0, it is helpful for interpretation by browsers. They say if you forget "/" at some tags like <img> then the page complies. This is not a correct way of practice. Hence, I decided to select one that looks easier to follow. I typed <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >. I knew that there is no compromise on capitalisation. For example, if I write "/tr/" in place of "/TR/" an error occurs. That forces me to change <html> beginning tag to <html xmlns="http://www.w3.org/1999/xhtml">. Having typed that, all the error points changed and their number reduced but new errors came out. <br> without ending "/" is not allowed. I used the "Edit -> Replace" command of IDE to do that job for me. Another simple change is that no tag or attribute or its value is allowed to remain capital. You cannot type <TABLE> or FONT-SIZE. They should be <table> and font-size, respectively.  The funny thing happened when I used "Replace" command to change table row tags from capital "TR" to lower case "tr" Suddenly number of errors rocketed up. Yes, the before mentioned file path, "/TR/" in the topmost declaration for using transitional XHTML also had been changed to lower case. Using the "Replace" command should be acompanied with caution to prevent damaging capitalisation of the content of the page already written. If I want to change all the paragraph tags and their end tags from capital to lower case with one command and with no qualm about the content I should say (to include end tags, as well) replace "P>" with "p> " Then no capital P at the beginning of a sentence will be changed. (Peter will not come as peter!) I changed all the deprecated attributes to correct ones, as well, without being worried about any mistake. I changed obsolete "name" attributes to "id" attributes. I followed the rules of W3C in using the correct literal adjectives instead of using those which looks correct to a coder's mind. For instance nowrap="true" should be replaced by nowrap="nowrap". Align attribute for image tag is "middle" but in other places it should be "center". I could not use <li> </li>without nesting them in <ul></ul>. I used the automatic intelligent tabs of the IDE to gradually correct my tables nesting structures by checking the returning columns of line-feeds until each table and each row and each column of it become closed at the right position symmetric to opening tags. Once you put the "id" of a data column in a row of a table it is not necessary to repeat it in other columns (one of the common errors of my OL template). I continued until my file opened in the NB IDE didn't show any error or any warning. I deleted the old file from the Microsoft Office Live Document Gallery and uploaded the new file then I went to W3C site and checked my newly uploaded page. Congratulation page appeared for my web page. Now, gradually I am refurbing other pages. I have some tags invented out there without full coordination with W3C bodies. One of them is the <fb:like> for facebook's "Like" button. If your page fails only for using tags like that but in terms of everything else is correct, use the W3C emblem. The visitor can check and appreciate that you have been meticulous in your design, but only failed for a widely used tag not yet been standardised. At the same time time put pressure on developers of Facebook, Creative Commons and some other important web entities to standardize their codes by offering them through RFC or other means to decision making committees of www. (I haven't checked, yet, if I can nest them as CDATA inside a script tag as work-around to pass the validator check, but I'll do and inform you later)
Update 17/Feb/11: I worked it out now.
Change your <html xmlns="http://www.w3.org/1999/xhtml"> tag to <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb=http://developers.facebook.com/schema/> to accommodate for Facebook extension. Then at the place that you wanted to plug the Facebook button in add the following Java Script:

Change attributes according to your requirements and taste. CDATA is not necessary and commented out. My "Downloads Page" now have passed the W3C Validator check successfully.

Monday, 31 January 2011

Dysprosium: Messiah's "Codes For Us" PDF Software Package Under Way

(For the latest PDF files Merger Software please have a look at the top of the left margin, inside the red box.) Now I have fulfilled part of my promises for a free PDF software suite, without overly bloating it. Under different stress tests I have done , there appears a couple of issues. For example, some rare happening exception would not report them in a relevant dialogue. As the software, in contrast to some other software, keeps the original file untouched, these exceptions have not a damaging edge. But, in principle, they should be reported. Other important issue is when PDF files exceed a size of 0.5 GB. One needs to have enough resources in their computer to handle them. All other applications should be closed. I have tested merging of two 450 MB files with 4GB of RAM and effective CPU speed of 4.5 GHz that takes almost (less than) ten minutes. We still do not work on powerful algorithms that can rival with Adobe very recent standards in level of two or three GB or even larger files. Files of these sizes, are barely used by public. They could be high resolution scanned files of 600 dpi many of them concatenated already together. We also have not hardware resources to check if we can use "Dysprosium" PDF suite of ours to be used in traditional barrier of 1.5 GB. That should be checked with at least a dual core CPU (effective clock of 5.2 or more) and minimum of six GB of physical memory. Hence, if  an exception of "failed map" were thrown by very large files, it is likely due to lack of hardware resources thrown by native operating system, rather than my PDF merging software. We are on the course to be assured on those targets in first release candidate of  "Dysprosium" in this current year. There are buttons in different places disabled for now. Their functions are under construction. Software will always remain free. "Free as we have in freedom and as we have in free beer;" quote from now a lost link on the Internet. We humbly become happy if we understand our work is of some benefit to other people and they are using it in ease. We have this powerful means and the related tools of communication thanks to millions of hours of free work offered by hard-working individuals all around the world.
(Dysprosium is registered to be used as the name for Messiah's "Codes For Us" PDF Software Package.)

Sunday, 9 January 2011

Encryption Tablet (Version 1)

(For the latest PDF files Merger Software please have a look at the top of the left margin, inside the red box.) Now the encryption tablet (version 1) is out. You can use it to create a keystore and public private keys with different key algorithms, key sizes and signature algorithms. Also it is possible to create a secrete key from the keystore. Utility can be used to create PFX (PKCS#12) files from the available public-private key pair files. You might use the software for creation  PEM files from the PFX file, or convert the PEM file to a DER file. Other features of the software includes printing the Finger Print of the certificate to a text file (.fp file can be read with a notepad). You can create a request CSR file for getting a certificate and then importing the certificate to the keystore. Another desireable feature is "JAR Signing," using any of the certificates you might have imported or created in the key-store with the known alias and passwords of yours. There are other features, as well, to utilize. At this date (11/January/11) help page is mostly ready, but under development. Please download from here.


(15/January/2011: reported issue resolved. Although it is decades we have the poor "DOS" behind, still it shows itself here and there. Yes, it is recommended to instal in a folder with no blank character in its name; perhaps, not even in parent path. Its own default unzipped folder is the best.)

Tuesday, 7 December 2010

How to Digitally Sign a PDF Document?

(For the latest PDF files Merger Software please have a look at the top of the left margin, inside the red box.) Now this basic signature manager is ready in Codes For Us PDF Merging utility, beta_6_3 (here). It is yet far from being complete. You notice that to use it one needs a PFX (PKCS#12) to have ready somewhere either self-signed or CA signed. I have a humble tweak GUI to create that PFX at home using self signature, available in download area. My 'uber-geek' friend Grant Hardy (who is a microwave engineer and has implemented Messiah's Calendar [he sleeps on a Smith's Chart at nights]) has promised to give a hand to meet our promised milestone around the Christmas, for further features to be accompanied (e.g., a password remover is ready now done by him, a password unlocker he is also interested as a matter of algorithm tests, not by using a brute force). With this Signature Manager one cannot put her seal emblem on the digital signature. It is just a standard digital signature of PDF documents as it is defined. The Water-mark utility provided by Codes For Us might meet that demand, if one is interested. But people are interested to have emblem next, or as under-layer to their digital signature, too. Hence, I try to add that feature, later to the manager (04/Jan/11: Now the feature is added)). I hope you enjoy this version for now.
Update 04/January/11: Now notarize PDF with external timestamp, seal emblem under-layer, and few other features are included. Codes For Us PDF Merging utility, 01/March/11, beta_6_7 (here).
Update 05/March/11: Now with a visual help page (here).

Sunday, 14 November 2010

How to Make a PFX (PKCS #12) File for Encryption for Free?

(For the latest PDF files Merger Software please have a look at the top of the left margin, inside the red box.) There are many situations that you use Java to create public and private keys to be exported as PCKS#12 encryption file for certification. (Please also read "How to Digitally Sign a PDF Document?" here.) Perhaps, there are commercial software for this end. An Internet search for this subject shows that doing that in free open software normally is not easy without much tweaking. This package of mine (Download here) is a self sufficient (and tweak-able, for interested people) light package for that. We know that PFX format for certification is the only format that supports export of a private key together with its  certification. This make this format more important than the other formats.  One can create public and private keys using Java Key Tools, but exporting them in form of PFX file format is not an easy job to do, if you like to do it free. I gathered available free tools to do it on Windows 7 (and other Windows down to Win98), without need to install anything else and in a self sufficient way. Regretfully, I have many professionally-hobbyist software on my computer and have not much clue that if some of them is being evoked (should be some Microsoft Visual C++ library, look into the C drive Windows folder and then in the "winsxs" for an x86_microsoft.vc90 something files) in handling my small package. I included a copy of "Redistribution," in case you need, but I believe the interested people already should have those libraries somewhere in their windows. If you received the message as, "Windows cannot do the specified job." Or something like that then you need to install that Redistribution from the "Software" folder available inside my package. The arranged package should be able to work with all the Windows(R) operating systems after Win98. To utilize the command line version of my software, you need to unpack the zipped folder (I use the open source free 7-zip utility as the best to pack and unpack zipped file folders). In the unzipped folder there is a batch file "pfx_util.bat". You can double click on this file and then follow instructions. There is also a help text file for further clarification. Please go here to download.
New! (18/November/10) GUI version of the software is available now. You can use either of command line version or GUI "jar" file version (an improved version is on the way) (11/01/11: Now it is out).

Sunday, 17 October 2010

How to Watermark and Stamp a PDF File for Free?

(For the latest PDF files Merger Software please have a look at the top of the left margine, inside the red box.) Now this first version of software for watermarking, stamping pdf files with text and image is ready. User can change font size of the text and decides for the font and style. They also can  decide for the position and the angle that text appears on the page. Some PDF creators such as the scanners create PDF's which are completely opaque. In such PDF's watermarks go under the PDF box becomes hidden and unseen. In such cases my software allows users to put the watermark on the top of the pdf over the box. If the watermark obscures part of the texts then you can reduce the opacity of the watermark to become transparent enough to make the underlying text visible for reading. Then looks as if it is under the text. You can reduce opacity to zero to create a hidden watermark later can be recognized by you. If you use a hidden watermark "web URL" on your PDF, at its position a link becomes created that shows itself with the small "clicking" hand.cursor. In this way you can make your document active. User can change direction of the stamp or the watermark text between 90 degrees clockwise (-90) and 90 degrees counter-clockwise (+90), perhaps to be used for the landscape pages. The position where you put the watermartk is selected visually on the "measurement board" by a "double-click" on the "Get Mouse" button. Measurement board shows relative places of your document. Precise coordinates in terms of the size of the page of your document are shown in the X and Y text boxes at the bottom of the GUI. If you "double-click" on the cross hair point, those coordinates will be registered for the watermarked document. Then press on the OK button to have your stamped document. The resulting document comes with a filename that does not exist in the directory hence, your original remains as before untouched.
You can select to use an image for the watermarking. If you decide to put the image as the over layer on your pdf document there is an option in this software such that you can change its opacity to make it transparent and to be able to see contents underneath of the page. You also can choose to blow up your image in terms of the percentage, by adjusting knob. Enjoy!
Please go here

Wednesday, 6 October 2010

PDF's Bookmarks, Outlines and Table of Contents

(For the latest PDF files Merger Software please have a look at the top of the left margin, inside the red box.) The merge software is like a clip or staple that people use in offices to attach separate pages with different dimensions and content. The software does not change them or enhance them in any way as it should not and is not intended, except that you decide for it. One kind-hearted user's asked me if the bookmarks emerge as they were before the manipulation. The answer is affirmative. Please, have a look at this video, consolidating three files one of them a tome of one thousand page attached to two other book. As one of the books has not originally bookmarks in its PDF creation by the author, it remains without a bookmark in the merged volume of total 1600 pages.  
How one can create an outline of a book after having an "engraved frozen" PDF depends on the author. One example is when you have a volume of your old diaries scanned into the PDF and you like to create an outline for it to make it more lively for navigation. You like to click on the "Christmas of 1989" and go to that page immediately without having to search many random pages. In the road map for developing this package, I have that target to hopefully implement but for a while later (4/Jan/11: from version beta_6_4 implemented ). That also can create a table of contents (12/Feb/11: from version beta_6_5 implemented) as a by-product.