PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

Moderators: TrackerSupp-Daniel, Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan, Ivan - Tracker Software

 
User avatar
Shaun Luttin
User
Topic Author
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Update page count after deleting a page

Tue May 08, 2018 8:59 pm

After deleting a page from a PDF, the Navigation Toolbar does not update itself automatically.

Capture.PNG
Capture.PNG (5.5 KiB) Viewed 222 times


Expected Behavior:

1. Delete a page.
2. The Navigation Toolbar updates the number of pages.

Actual Behavior:

1. Delete a page.
2. The Navigation Toolbar does not update.
3. Mouse over the Navigation Toolbar.
4. The Navigation Toolbar updates the number of pages.

How do we update the navigation toolbar without having to move the mouse in to it?

We currently delete a page from a PDF document with this C# code:

public void DeletePages(int documentId, int startIndex, int endIndex) {
    try {
        var rangeText = BuildPageRangeText(startIndex, endIndex);
        _viewer.SetProperty("Operations.DeletePages.RangeType", "Exact");
        _viewer.SetProperty("Operations.DeletePages.RangeText", rangeText);
        _viewer.DoDocumentVerb(documentId, null, "DeletePages", null, out _, (int) PXCVA_Flags.PXCVA_NoUI);

        SaveDocument(documentId);
    }
    catch (COMException ex) {
        _viewer.GetTextFromResult(ex.HResult, out var message);
        throw new Exception(message, ex);
    }
}

// saves the document in place
public void SaveDocument(int documentId) {
    // saves the document in place
    _viewer.SaveDocument(documentId, null, 0, 0);

    // Set the document's modified property to false, to remove the (*) from its tab.
    _viewer.SetDocumentProperty(documentId, "Modified", 0);
}
 
User avatar
Shaun Luttin
User
Topic Author
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Re: Update page count after deleting a page

Tue May 08, 2018 10:47 pm

This remains unsolved. That said, here is a workaround that refreshes the navigation bar:
_viewer.DoVerb(null, "ExecuteCommand", (object) "TogglePagesNavigationBar", out var _);
_viewer.DoVerb(null, "ExecuteCommand", (object) "TogglePagesNavigationBar", out var _);

Toggling the navigation bar twice refreshes it.
 
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1895
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Update page count after deleting a page

Fri Jun 08, 2018 5:09 pm

Hi Shaun Luttin.

We will fix that issue in new upcoming build.

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

Who is online

Users browsing this forum: No registered users and 4 guests