galkahana/PDF-Writer — pull request #22 by filodej (2014-09-26 22:46:27+00:00)
Title: Copy PDF Page rotation properly

Hi Gal,
thank you very much for merging my previous pull request.

I just realized that I forgot to propagate rotation in `PDFDocumentHandler::CreatePDFPageForPage()`. So this pull request should fix that omission.
Of course I have extended the `RotatePagesPDF` test accordingly to perform all three steps: 1) Create 2) Copy and 3) Parse rotated pages.

Then there is the third commit, just in case you find it usable (otherwise feel free to ignore it).
It seems to me that in some cases there is no need to allocate objects dynamically. As they have a limited lifetime (bound to current scope) it should be OK to use stack allocated objects - It's both safer and more efficient.
In the `CreatePDFPageForPage()` method there is `PDFPage` instance used temporarily and it is exactly like that - so I changed it.
I realize that in order to be able to pass the `PDFPage` pointer to the `OnAfterCreatePageFromPage` I had to move it outside the `while` scope - so now it is executed before the `CopyResourcesIndirectObjects` insead of after (as its constructor performs only a trivial initialization it should not be a problem).
Anyway, if you do not like it, please, just ignore the third commit, I just wanted to send it for your consideration.

Best Regards,
Petr