iOS > WKWebView > Outline initialisation

69 views
Skip to first unread message

mi...@stellarlibrary.com

unread,
Jul 4, 2017, 4:19:50 PM7/4/17
to PDFTron WebViewer

Hi,

We have single instance with a 250x page document with many outlines.

On iOS when you activate outline view the first time, it flashes the outline content but then renders a white page. Subsequent outline view activation renders the outline as expected.

We also see a triple flickering of the document page when an outline item is selected and page rendered. In your stock standard webviewer we do not see this triple flicker. If you could provide us some pointers to investigate that further, would be appreciated.

Regards

Mike

Justin Jung

unread,
Jul 5, 2017, 5:37:29 PM7/5/17
to PDFTron WebViewer
Hello,

We have trouble reproducing the issue.
Would you be able to provide us the document that causes the flickering?

Justin Jung
Software Developer
PDFTron Systems Inc.

Justin Jung

unread,
Jul 11, 2017, 7:17:01 PM7/11/17
to PDFTron WebViewer
Thanks for sending us the document.
You can add the following to config.js to fix the problem with rendering just a white page:

$(document).on('viewerLoaded', function() {
  var onSliderStart = ReaderControl.prototype.onSliderStart;
  ReaderControl.prototype.onSliderStart = function() {
    onSliderStart.apply(readerControl, arguments);
    readerControl.onSliderMove();
  };
});

But I'm not sure if this is related to the flickering.
Please let me know if it resolves the other issue as well :)

mi...@stellarlibrary.com

unread,
Jul 18, 2017, 11:53:22 AM7/18/17
to PDFTron WebViewer
Thanks Justin,

That works, and also significantly reduces the flickering; only flickers (less aggressively) for a subset of elements now.

Regards

Mike

mi...@stellarlibrary.com

unread,
Sep 5, 2017, 12:01:21 PM9/5/17
to PDFTron WebViewer
We have another document that does not display the Outline on first access.

It is a sensitive 272x page document that we cannot supply for review.

Q. Any ideas for us to pursue ?

Regards

Mike

Justin Jung

unread,
Sep 5, 2017, 7:13:51 PM9/5/17
to PDFTron WebViewer
Hello Mike,

Is this for desktop or mobile viewer? or both?
Just to double check that there is an outline on the file, you can unzip the xod and look for Document/Structure/DocStruct.struct which should have outline data.
Then you can start debugging updateBookmarkView function in readerControl and check that the bookmark data is being resolved in getBookmarks promise.

mi...@stellarlibrary.com

unread,
Sep 6, 2017, 12:22:50 AM9/6/17
to PDFTron WebViewer
Hi Justin,

iOS WKWebView mobile viewer.

The outline appears, just not on first view; You access outline, click annotations, then outlines again to see the outline.

Will follow your lead later this week, however if you have anything concrete in the interim would be appreciated.

Regards

Mike

Justin Jung

unread,
Sep 7, 2017, 7:08:19 PM9/7/17
to PDFTron WebViewer
You could start with debugging createBookmarkList function in MobileReaderControl.js to see what bookmark data is being returned from the document.
Hope that gets you started in the right direction.

mi...@stellarlibrary.com

unread,
Sep 12, 2017, 5:41:17 PM9/12/17
to PDFTron WebViewer
Justin,

ReaderControl.prototype.onSliderStart()

This function no longer fires.

We have a 'bookmarkString' it displays briefly before disappearing again on first access of the 'Outline' view.

Any further insights appreciated.

Mike

Justin Jung

unread,
Sep 13, 2017, 7:09:04 PM9/13/17
to PDFTron WebViewer
To clarify, by "Outline" are you to referring to the thumbnails at the bottom of the page (that appears when you drag the slider)?
It's really hard to determine what might be causing the problem, since it seems to be related to customizations you've made.

mi...@stellarlibrary.com

unread,
Sep 18, 2017, 1:41:55 PM9/18/17
to PDFTron WebViewer
Hi Justin,

I refer the outline view that is tab in a drawer next to annotations. If you have not further leads, I will attempt to duplicate in a bare bones project.

Mike

Justin Jung

unread,
Sep 18, 2017, 5:56:22 PM9/18/17
to PDFTron WebViewer
As mentioned, it is difficult to tell as it could be related to customizations.
Let us know if you are able to reproduce it in a bare bones project.

mi...@stellarlibrary.com

unread,
Sep 18, 2017, 7:28:35 PM9/18/17
to PDFTron WebViewer
I could not reproduce in a bare bones project, with and without encryption.

Thanks for your pointers, will see where our customisations introduce this quirk.

Regards

Mike

mi...@stellarlibrary.com

unread,
Sep 27, 2017, 12:39:53 PM9/27/17
to PDFTron WebViewer
We debugged the fault; the content was hidden with CSS. We removed the inline CSS style property and all is well.

MobileReadercontrol.js.createBookmarkList()

var newLiString = '<li style="" data-icon="false" class="bookmark-item"  data-pagenumber="' + pageData + '">' + liContent + '</li>';

Mike

Matt Parizeau

unread,
Sep 27, 2017, 7:26:53 PM9/27/17
to PDFTron WebViewer
Interesting that removing the style fixes your issue. I believe that inline transform was added a while back to fix an issue with bookmarks not showing up in iOS6 so it likely wouldn't have any negative effects elsewhere.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages