September 24, 2013 2 Comments
This is going to be one of the last posts by me under the GSoC 2013 tag. The Google summer of Code program is coming to its end with today being the ‘strict pencil down‘ date. The project was about improving the textLayer of the PDF.js.
My work started from fixing the canvas methods to generate complete details about the text position, height , width, angle etc using formulas which are present in the project proposal. After that I worked on the textLayer code to make use of those information and place the textLayer divs above the canvas. I worked on the vertical text issue separately which needed a few more adjustments after the canvas – textLayer overlapping was over.
Then I started working on the generator code where I needed to implement various parser operators to get text position, angle and direction. This part of the project was the most important and most challenging part as the code needed to be built from the level zero. I had to read a lot of documentation to get the formulas to be used and to debug test pdfs to make sure all the operators required are implemented. I had to manually run test on all pdf documents present in master/test/pdfs/ to make sure the final code was good to go. When final code for this issue landed it was a big relief as implementation of this will improve the textLayer rendering and parsing easier. We can remove many lines of code from the canvas part of PDF.js now cause of the patch submitted.
The project is still in progress as I was not able to attend the issue related to text lines appearing in one single line when copy pasted, but because of the previous patch which was submitted, resolving this issue wont be hard now.
I have published the code on my gh-pages you can take a look if you go through my github account which is https://github.com/SSk123 or can directly try to view the published code from http://ssk123.github.io/pdf.js/
In the end I would want to thank from the bottom of my heart to my mentors Yury, Brendan and Bill. If it was not for you guys I would have not made these contributions. I really admire the patience with which my mentors have assisted and guided me and I would just want to say guys are really the coolest people I have talked to and it was such a pleasure and honor to work and learn under you. I look forward to make more contribution to PDF.js and Mozilla as a whole.
Signing off .. :)