displayModeManager.setDisplayMode() rendering the document a second time

Product:
pdftron/webviewer

Product Version:
8.9.0

Please give a brief summary of your issue:
Problems using VirtualDisplayMode when changing DisplayMode.

Please describe your issue and provide steps to reproduce it:
Using PDFTron without a WebViewer instance I change the DisplayMode like this:

const pdfTronCore = (window as any).Core;
const displayModeManager =
  this.documentViewer.getDisplayModeManager();
displayModeManager.setDisplayMode(
  new pdfTronCore.DisplayMode(
    this.documentViewer,
    DisplayModes.FacingContinuous
  )
);

Afterwards the document gets attached to DOM in FacingContinuous above the virtualListContainer like this:

Is there a better way to change the DisplayMode? Since I don’t use WebViewer I cannot use

instance.setLayoutMode(LayoutMode.FacingContinuous);

Any help appreciated!

Cheers,
the annoying guy with the custom UI :wink:

Hello jherbe!

This does look like a bug, thank you for reporting this. I assume this will also confirm that the other forum post is also a bug…

Ill add this to our backlog, thank you again.

Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron

Hey Tyler!

Thanks for the confirmation. Do you mean the post about the unnecessary iFrame? A fix for this would be awesome since it produces a vertical scrollbar in my layout.

Cheers,
jonas

Hey jherbe,

Yep! I believe our code for disabling the virtualListContainer might be the issue.

Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron