Save rotated page to the existing Tiff file

I need to write some code that will allow a user to load a tiff document to the screen (.NET Forms) and view it page by page.
They might choose to rotate one of the pages.
How would I save the document after they rotate one of the pages?
This is my code so far:

    Private Property MemoryPageStreamFactory As MemoryPageStreamFactory
    Private Property tiffViewer As Viewer
    Private Property jpgViewOptions As JpgViewOptions

    Private Sub LoadPageIntoViewer(ByVal PageNumber As Integer)

            Dim FileName As String = "FilePath/FileName.tiff"
            tiffViewer = New Viewer(FileName)

            MemoryPageStreamFactory = New MemoryPageStreamFactory()
            jpgViewOptions = New JpgViewOptions(MemoryPageStreamFactory)
            tiffViewer.View(jpgViewOptions, PageNumber)

            MemoryPageStreamFactory.Stream.Position = 0
            pictureBox.Image = System.Drawing.Image.FromStream(MemoryPageStreamFactory.Stream) 

            Dim tiffViewInfo As Results.ViewInfo = tiffViewer.GetViewInfo(ViewInfoOptions.ForJpgView)
            txtPages.Text = tiffViewInfo.Pages.Count

    End Sub

    Private Sub btnRotate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRotate.Click

            Dim selectedPage As Integer = txtPage.Text

            jpgViewOptions.RotatePage(selectedPage, Rotation.On90Degree)

            tiffViewer.View(jpgViewOptions, SelectedPage)
            MemoryPageStreamFactory.Stream.Position = 0
            pictureBox.Image = System.Drawing.Image.FromStream(MemoryPageStreamFactory.Stream)

    End Sub

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
            ' Save the tiff. If possible, it would be best if we can save the rotations now, instead of each time they click the Rotate button
    End Sub


Thank you for adding your code.

How would I save the document after they rotate one of the pages?

GroupDocs.Viewer does not modify a source document when you call any methods. Think of GroupDocs.Viewer as function that accepts a document and outputs HTML, image, or PDF.

You rather want to save output page somewhere or page rotation angle. So, next time you render a page you’ll set it the stored rotation angle. Is it suitable for you?

Yes, that works
Thank you


You’re welcome!