Is there any way to reset the rotation value of a page to 0
while maintaining the correct orientation?
I’ve attached a PDF which displays this behavior.
As a solution you can call page.SetRotation(Page.Rotate.e_270), and rotate page media & crop box (similar to Rect sample - pdftron.com/pdfnet/samplecode.html#Rect
) and also add a transform matrix that will rotate all page content. The last part is a bit more tricky… You can use ElementEdit approach (http://pdftron.com/pdfnet/samplecode.html#ElementEdit
), where you adjust the transform on the initial element (you could surround all content with e_group_begin/end element; i.e q/Q). Perhaps a simpler approach is to approach shown in Imposition sample (http://pdftron.com/pdfnet/samplecode.html#Imposition)
... where you place an existing page on another page (in your case that would be rotated page).