Rotation Bug for PDF.js

So I have been working this bug. Basically the problem was that pdf.js did not remember the page rotation of the PDF. This was somewhat more involved than my previous two bugs. I was still working the web directory, but now I needed to figure out what code to write and where to place the code for this to work. I asked on the bug page and was directed by Tim van der Meij to piece of code in the right file. I examined that for a while. Then started hacking away at it trying to get it to work. But with each change I made, there was nothing happening to PDF.

I then left it alone for a few hours and then came back to it. I then saw that there pagesRotation variable that I could access and set. So using that, I set it to 90 degrees at first and it worked. Going forward I set it to the user changeable variable and I was done. Or so I thought. After I submitted the pull request. Almost immediately the code was reviewed and I was instructed to make some changes. Now using the rotatePages function in the code that I wrote, PDF.js remembers the page rotation on reload.

My pull request: https://github.com/mozilla/pdf.js/pull/5949

Advertisements