Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9065759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:35:10+00:00 2026-06-16T16:35:10+00:00

This is a complex situation wich I can´t find the anwser. I am trying

  • 0

This is a complex situation wich I can´t find the anwser.

I am trying to implement PDF.js in my Asp Net MVC 4 project.

I have a view page responsable for displaying the pdf in the browser.
It works fine as long as I declare the api.js within this page.

I need to move the api.js call to the head in my layout view.
Doing this the api.js is loaded and I can see it in firebug.
Although the pdf is not loaded.

This is the api.js
http://pastebin.com/JAnZVcbC

The only part of the api.js I have changed is this:

if (!globalScope.PDFJS.disableWorker && typeof Worker !== 'undefined') {
    var workerSrc = '/pdf.js/worker_loader.js';
  if (typeof workerSrc === 'undefined') {
    error('No PDFJS.workerSrc specified');
  }

  try {
    // Some versions of FF can't create a worker on localhost, see:
    // https://bugzilla.mozilla.org/show_bug.cgi?id=683280
      var worker = new Worker('/pdf.js/worker_loader.js');
    var messageHandler = new MessageHandler('main', worker);
    this.messageHandler = messageHandler;

As you can see I defined workerSrc with the URI pointing to the file.

Have you guys experience with this librarie and could give to me some advice on how to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:35:12+00:00Added an answer on June 16, 2026 at 4:35 pm

    Too complicated for me but I think you have to call PDFJS.getDocument after the page loads. You included javascript…OK… but do you trigger it?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can/should One use any ORM Solution is a Complex Situation like this ? can
Here's the situation: i have a SearchPage where an user can make a complex
I have this complex situation: a database of countries/regions/states/cities which primary key is composed
Hope you guys can help me. This is my situation. I have a stored
imagine this situation: SetUp in the default MVC3 project, create a new complex type
This is somewhat complex (well to me at least). Here is what I have
Hopefully this is less complex than I think. I have one table of companies,
It may well be that I have to write something overly complex for this
I've got this complex situation. Created EF with Model first and here are my
This is a pretty odd situation I have here. I have used a piece

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.