DocumentUltimate Fit To Height not working?
Question asked by Chris Simpson - 7/30/2021 at 9:04 AM
I am currently investigating how we can control DocumentUltimate from JavaScript so that we can hide the built-in toolbar and instead use our own so that our viewer page will match the look and feel of our application.

I can get a reference to the document viewer in JavaScript as follows:

    var documentViewer = new DocumentViewer()
        ClientEvents = new DocumentViewerClientEvents
            Loaded = "onViewerLoaded"

<script type="text/javascript">
var documentViewer;

function onViewerLoaded(sender, e) {
        documentViewer = sender;
If I then call documentViewer.fitWidth() or documentViewer.fitPage() then the fit mode of document being viewed is changed as expected. If I call documentViewer.fitHeight() then this appears to have no effect.

I've also found that calling documentViewer.getFitMode() after documentViewer.fitHeight() confirms that the fit mode has not changed to "FitHeight". I can only seem to get back either "FitWidth" or "FitPage" depending on what the previous setting was.

Reply to Thread