PDF Viewer - Open At Top?

Nextcloud version (eg, 12.0.2): 17.0
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04.3
Apache or nginx version (eg, Apache 2.4.25): 2.4.29
PHP version (eg, 7.1): 7.2

The issue you are facing: When viewing PDF documents via the official PDF viewer, it frequently opens the documents at the bottom or even past the bottom of the document. How can I make it open the document at the top of page 1?

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Navigate to a .pdf file
  2. Click on the .pdf

The behavior is intermittent. It seems to happen with some PDFs, but not with others. It looks like maybe the scroll position from the file browser is preserved when you open the PDF. e.g. If I browse a folder with only a few documents, and I open a PDF, it opens at/near the top. But if I browse a folder with many documents, and I scroll down several pages and open a PDF, that PDF will begin viewing at/after the end of the last page.

The output of your Nextcloud log in Admin > Logging:

No server logs
Everything is working fine

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'trusted_domains' =>
  array (
    0 => 'private1',
    1 => 'private2',
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'trusted_proxies' =>
  array (
    0 => '192.168.1.1',
    1 => '192.168.1.10',
    2 => '127.0.0.1',
  ),
  'overwriteprotocol' => 'https',
  'overwritewebroot' => '',
  'overwritecondaddr' => '^192.168.1.10$',
  'forwarded_for_headers' =>
  array (
    0 => 'HTTP_X_FORWARDED_FOR',
  ),
  'onlyoffice' =>
  array (
    'verify_peer_off' => true,
  ),
  'session_lifetime' => 21600,
  'instanceid' => '12345',
  'passwordsalt' => '12345',
  'secret' => '23456',
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '17.0.0.9',
  'overwrite.cli.url' => 'http://boxtop',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'private3',
  'dbpassword' => 'private4',
  'installed' => true,
  'maintenance' => false,
  'app_install_overwrite' =>
array (
    0 => 'onlyoffice',
    1 => 'files_clipboard',
    2 => 'files_external_gdrive',
  ),
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' =>
  array (
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'mail_from_address' => 'email_relay',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'example.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'private@example.com',
  'mail_smtppassword' => 'veryprivate',
  'mail_smtpsecure' => 'tls',
);

The output of your Apache/nginx/system log in /var/log/____:

[Sat Oct 26 16:30:59.222267 2019] [mpm_event:notice] [pid 41:tid 139754566908864] AH00489: Apache/2.4.29 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 configured -- resuming normal operations
[Sat Oct 26 16:30:59.222403 2019] [core:notice] [pid 41:tid 139754566908864] AH00094: Command line: '/usr/sbin/apache2'
[Sat Oct 26 16:30:59.223313 2019] [:notice] [pid 43:tid 139754566908864] FastCGI: process manager initialized (pid 43)

Afaik, there is currently no option to prevent this behavior. You should check the issue list of the app and if you couldn’t find the described issue, it would be worse to create a new issue ticket for it.