Custom Config in PDFTron.WebViewer is not supporting J query.

198 views
Skip to first unread message

Anish Jain

unread,
Mar 11, 2014, 8:56:04 AM3/11/14
to pdfnet-w...@googlegroups.com

Hi,
    We are facing issue related to integration of PDFTron.WebViewer reader control into our code.

    For that we are passing "CustomConfig.js" in config of "PDFTron.WebViewer",

    but we are facing issue i.e we are not able to code in J query in "CustomConfig.js" file.

    PDFTron.WebViewer({
                config: URL("/Resources/Scripts/WebViewerConfig.js")
    }


    For writing small functionality we are facing a lot of issue.

    We are using .Net MVC4 architecture and HTML5 / HTML5 Mobile.

Thanks,
Anish Jain

Matt Parizeau

unread,
Mar 11, 2014, 12:45:30 PM3/11/14
to pdfnet-w...@googlegroups.com
Hi Anish,

jQuery is able to be used in config files as you can see by their use in the provided samples in the WebViewer download.  Are you receiving an error when you try to use jQuery in your config file?  Are you sure that the config file is being loaded correctly?  Check the developer console (F12) to see if there are any messages about the config script not being loaded.  For example in Chrome it would say "Config script could not be loaded. The default configuration will be used."

To better debug your config script there a couple of ways.  One way is to put a debugger; statement in the config file and when this line of code is hit it will automatically break if the developer tools are open.  Another way is to add the line //# sourceURL=myConfig.js to the bottom of your script.  In Chrome this will have the script show up in the sources under "no domain" and you'll be able to debug more easily to see what the problem is.

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