pdftronpdfnet

Pdf jumps to page 2 when opening


I used the C# sample of PDFViewSimpleTest

When opening a pdf, it automatically jumps to the second page.

Foxit does it too (so i guess they also use pdfTron), Adobe starts from page 1

I haven't got a clue why. The pdf can be found here: http://docdro.id/EDsbCcH

The code is really simple:

public bool OpenPDF(String filename)
    {
        try 
        {
            PDFDoc oldDoc = _pdfview.GetDoc();
            _pdfdoc = new PDFDoc(filename);
            if (!_pdfdoc.InitSecurityHandler())
            {
                AuthorizeDlg dlg = new AuthorizeDlg();
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if(!_pdfdoc.InitStdSecurityHandler(dlg.pass.Text))
                    {
                        MessageBox.Show("Incorrect password");
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }
            _pdfview.SetDoc(_pdfdoc);

            _pdfview.SetPagePresentationMode(PDFViewCtrl.PagePresentationMode.e_single_page);


            filePath = filename;
            if (oldDoc != null) 
            {
                oldDoc.Dispose();
            }
        }
        catch(PDFNetException ex)
        {
            MessageBox.Show(ex.Message);
            return false;
        }
        catch(Exception ex)
        {
            MessageBox.Show(ex.ToString());
            return false;
        }

        this.Text = filename;  // Set the title
        return true;
    }

Solution

  • Please try the latest version.

    Official: https://www.pdftron.com/pdfnet/downloads.html

    Nightly Stable/Production: http://www.pdftron.com/nightly/?p=stable/