Calling JavaScript

229 views
Skip to first unread message

Aly

unread,
May 1, 2012, 4:48:14 PM5/1/12
to pdfnet-w...@googlegroups.com
<script type="text/javascript">
webViewer = new WebViewer("html5,silverlight", {
initialDoc : "../Documentation.xod"
});

webViewer.setLayoutMode('Single');
</script>

Can you tell me whats wrong with this code? I cant set the layoutmode to single.

Thanks

Aly

Vincent Ycasas

unread,
May 1, 2012, 5:19:39 PM5/1/12
to PDFTron WebViewer
If you wish to set the layout mode to single page, you will to pass
either: WebViewer.LayoutMode.Single (enum) or "SinglePage" (string).
For example:

<script type="text/javascript">
webViewer.setLayoutMode("SinglePage");
</script>

Vincent Ycasas

unread,
May 1, 2012, 5:32:23 PM5/1/12
to alybo...@gmail.com, pdfnet-w...@googlegroups.com
Hi Aly,

If you can send over the .html file you are currently working on (just paste the whole .html code in this e-mail), we may be able to figure out what exactly is going on.

Best Regards,
Vincent Ycasas
vyc...@pdftron.com
PDFTron Systems, Inc.
http://www.pdftron.com/

On 05/01/2012 Tue 2:25 PM, Aly Boghani <alybo...@gmail.com> wrote:
I have tried following in my code but none of this works. Can you
please help me out?

webViewer.setLayoutMode("SinglePage");
    webViewer = new WebViewer("html5,silverlight", {
        initialDoc : "../documentation.xod"
    });



    webViewer = new WebViewer("html5,silverlight", {
        initialDoc : "../documentation.xod"
    });
webViewer.setLayoutMode("SinglePage");



On Tue, May 1, 2012 at 4:19 PM, Vincent Ycasas <vyc...@pdftron.com> wrote:
--
You received this message because you are subscribed to the "PDFTron WebViewer" group. To post to this group, send email to sup...@pdftron.com
To unsubscribe from this group, send email to pdfnet-webview...@googlegroups.com. For more information, please visit us at http://www.pdftron.com/pdfnet/webviewer

Aly Boghani

unread,
May 1, 2012, 5:25:24 PM5/1/12
to pdfnet-w...@googlegroups.com, vyc...@pdftron.com
I have tried following in my code but none of this works. Can you
please help me out?

webViewer.setLayoutMode("SinglePage");
webViewer = new WebViewer("html5,silverlight", {
initialDoc : "../documentation.xod"
});



webViewer = new WebViewer("html5,silverlight", {
initialDoc : "../documentation.xod"
});
webViewer.setLayoutMode("SinglePage");



On Tue, May 1, 2012 at 4:19 PM, Vincent Ycasas <vyc...@pdftron.com> wrote:

Support

unread,
May 1, 2012, 6:59:01 PM5/1/12
to pdfnet-w...@googlegroups.com

I see that you are actually attempting to load the document in Single Page mode by default. In this case use the following steps:


Open WebViewer/html5/ReaderControl.js file and find the following line in the code:

window.readerControl = new ReaderControl(iframe);


Add the following right after the line found:

 

window.readerControl.docViewer.SetDisplayMode(window.readerControl.docViewer.DisplayMode.Single);


It should go like:

window.readerControl = new ReaderControl(iframe);
window.readerControl.docViewer.SetDisplayMode(window.readerControl.docViewer.DisplayMode.Single);

Matt Parizeau

unread,
Mar 31, 2015, 4:31:11 PM3/31/15
to pdfnet-w...@googlegroups.com
With WebViewer 1.5.0 and older:

Open WebViewer/html5/ReaderControl.js file and find the following line in the code:

window.readerControl = new ReaderControl

Add the following right after the line found:
window.readerControl.setLayoutMode(CoreControls.DisplayModes.Single);

It should go like:
window.readerControl = new ReaderControl(viewerElement, enableAnnot, enableOffline);
window
.readerControl.setLayoutMode(CoreControls.DisplayModes.Single);

ch...@cwfent.com

unread,
Jul 26, 2013, 5:35:50 PM7/26/13
to pdfnet-w...@googlegroups.com

That did it Matt, thanks!!

On Friday, July 26, 2013 5:28:18 PM UTC-4, Matt Parizeau wrote:
With WebViewer 1.5.0 change this line to:
Reply all
Reply to author
Forward
0 new messages