Returning a different but similar "increasing" string depending on instance argument
The easiest way is to add a method to the ScreenViewer class which returns the page value, eg:

public abstract class ScreenViewer {
    public abstract int getPageCount();
}

public class ScreenViewerPage1 {
    @Override
    public getPageCount() {
        return 1;
    }
}

private getDescription(ScreenViewer o) {    
    if(Utils.isTotalPagesVisible()) {  
        int total = 5;          
    } else {  
        int total = 3;  
    } 
    return "Description:" + o.getPageCount() + " out of " + total ;  
}


But I would rethink your whole approach. What if you want to add ScreenViewerPage6? It's hard to say how exactly your code could be rewritten without knowing how the classes look, but I would assume that it should be possible with lists, etc.

Misc


Your indentation is off.
o is not a good variable name.
use else if when appropriate.
I would not hardcode magic numbers such as 5 and 3.