I have a process that detects rotated pages and sets their orientation to 0 but I also need to detect vertical text on a page and act on that. In the test files I an using the page has not been rotated but the text (rasterized) is vertical. Using the Acrobat 11.0 object model through VB.NET, how can I achieve that? The following code does handle where the page has been rotated but does not detect the vertical text. Any help is appreciated.
Private Sub cmdConvert_Click(sender As Object, e As EventArgs) Handles cmdConvert.Click
Dim AcroXApp As Acrobat.AcroApp
Dim AcroXAVDoc As Acrobat.AcroAVDoc
Dim AcroXPDPage As Acrobat.AcroPDPage
Dim AcroXPDDoc As Acrobat.AcroPDDoc
Dim JSO As Object
AcroXApp = CreateObject("AcroExch.App")
AcroXApp.Hide()
AcroXAVDoc = CreateObject("AcroExch.AVDoc")
AcroXAVDoc.Open(txtTargetFile.Text, "")
AcroXPDDoc = AcroXAVDoc.GetPDDoc
JSO = AcroXPDDoc.GetJSObject
Dim iPageCount = AcroXPDDoc.GetNumPages
For i = 0 To iPageCount - 1
Dim rotation = JSO.getPageRotation(i)
Select Case rotation
Case 90
AcroXPDPage = AcroXPDDoc.AcquirePage(i)
Debug.Print("Page " & i & " was set at " & rotation & " degree rotation")
AcroXPDPage.SetRotate(0)
Case 180
AcroXPDPage = AcroXPDDoc.AcquirePage(i)
Debug.Print("Page " & i & " was set at " & rotation & " degree rotation")
AcroXPDPage.SetRotate(0)
Case 270
AcroXPDPage = AcroXPDDoc.AcquirePage(i)
Debug.Print("Page " & i & " was set at " & rotation & " degree rotation")
AcroXPDPage.SetRotate(0)
End Select
Next
Dim strOutFileName As String = Replace(txtTargetFile.Text, ".pdf", "_Rotated.pdf")
JSO.SaveAs(strOutFileName)
AcroXAVDoc.Close(False)
AcroXApp.Exit()
AcroXApp = Nothing
AcroXAVDoc = Nothing
AcroXPDDoc = Nothing
JSO = Nothing
End Sub