question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A Good Example Needed

See original GitHub issue

I’m trying to use your application to make a widget for Yii Framework, but I can’t find where is my mistake once the pdf.js is compiled…

Steps I did:

  • compiled to obtain the “build” folder
  • moved th complete “build” folder where the Yii Framework needs
  • borrowed and renamed view.html to .php
  • I did the steps needed to work in a view in the Yii’s model (I’ll not boring you with technical stuff)
  • the “pseudo” header of that view says:
  <link rel="resource" type="application/l10n" href="<?php echo Yii::app()->request->baseUrl.'/js/pdf/web/';?>locale.properties"/>
  <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl.'/js/pdf/web/';?>viewer.css"/>
  <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl.'/js/pdf/build/pdf.js';?>"></script>
  <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl.'/js/pdf/web/viewer.js';?>"></script>
  <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl.'/js/pdf/web/l10n.js';?>"></script>
  <script type="text/javascript">
  var kDefaultURL = 'http://ps/prensa/PDF/queiroz_Mandarn_El.pdf';
  var kImageDirectory = '<?php echo Yii::app()->request->baseUrl.'/js/pdf/web';?>/images/';
[... the blablabla from viewer.html]
  • I rem’ed the lines where these vars are defined in “viewer.js” to get the file I need to render (next these will be replaced for php’s vars in run time)

PROBLEM TypeError: mozL10n is undefined http://ps/js/pdf/web/viewer.js Line 2634

I realized than a lot of “include” are replaced for “pdf.js” as you can see in the code above, but… 😦

I have no clue where to fix to get a “viewer” such as your “full example”, which I think it is very nice 😃

I’d very much like to contribute (almost in documentation), or other Yii Coders (in implementations or integration) if I can solve that and then I’ll shared to the Yii Comunity…

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yurydelendikcommented, Oct 28, 2012

mozL10n defined in l10n.js. Is there a reason why you placed it after viewer.js?

0reactions
DGEAPerezcommented, Oct 28, 2012

thanks 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Good Example Quotes - BrainyQuote
Few things are harder to put up with than the annoyance of a good example. Share this Quote · Mark Twain · A...
Read more >
good needs | English examples in context - Ludwig
High quality example sentences with “good needs” in context from reliable sources - Ludwig is the linguistic search engine that helps you to...
Read more >
The best 500 needed sentence examples - YourDictionary
The most voted sentence example for needed is Maybe they all needed to know. ... He needed the reminder of the good in...
Read more >
14 Examples of Needs and Wants - Simplicable Guide
14 Examples of Needs and Wants · Personal Needs · Personal Needs · Activities · Social Needs · Life Events · Life Decision...
Read more >
10 Qualities of a Good Employee (With Examples) | Indeed.com
3. Reliability · Showing up to work-related events · Coming to work on time · Consistently meeting deadlines · Producing high-quality work ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found