Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« PDF.js » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
création+catégories
 
cat:PDF (by SublimeText.Mediawiker)
 
(2 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
h3. Environnement de Test
== Setup testing environnement ==


<syntaxhighlight lang="bash">
  sudo apt-get install nodejs npm
  sudo apt-get install nodejs npm
  cd <pleade-entreprise>/src/webapp/theme/js/
  cd <pleade-entreprise>/src/webapp/theme/js/
  git clone git://github.com/mozilla/pdf.js.git pdfjs
  git clone git://github.com/mozilla/pdf.js.git pdfjs
</syntaxhighlight>


h4. Server de test :
=== Start Test Server ===


<syntaxhighlight lang="bash">
  cd ./pdfjs/
  cd ./pdfjs/
  nodejs make server
  nodejs make server
</syntaxhighlight>


Ensuite on pourra accéder au "server de test via":http://localhost:8888/web/viewer.html :
Then you can reach this {{value|nodejs}} server via the following url : http://localhost:8888/web/viewer.html


http://localhost:8888/web/viewer.html
  http://localhost:8888/web/viewer.html


Pour tester un document a vous, il faut le placer dans le répertoire @test/@ et y accéder de la façon suivante :
You can test your own document by placing them into the {{path|test/}} directory and using URL such as :


http://localhost:8888/test/fichier-de-test.pdf
  http://localhost:8888/test/your-test-file.pdf


h4. PDF généré par Pleade
=== Opening PDF from your website ===


Il faut lancer une URL du type en passant le paramètre @file@ en échappant l'URL du fichier a lire :
You need to use the {{attr|file}} parameter in the URL whom value is a full [https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURI encodedURI]:


http://mozilla.github.com/pdf.js/web/viewer.html?file=http%3A%2F%2Fasync5.org%2Fmoz%2Fpdfjs.pdf
  http://mozilla.github.com/pdf.js/web/viewer.html?file=http%3A%2F%2Fasync5.org%2Fmoz%2Fpdfjs.pdf


h3. Création du build de PDF.js
== Compile the PDF.js ==


Il faut utiliser créer un symlink de @nodejs@ vers @node@ sinon le build bloque sur :
=== For Linux ===
Linux user need to create a symlink from {{cmd|nodejs}} to {{cmd|node}} otherwise the build will stall on:


### Getting extension build number
  ### Getting extension build number


On peut le faire de la façon suivante :
On {{value|Debian}}/{{value|Ubuntu}} you can do :
<syntaxhighlight lang="bash">
sudo ln -s $(which nodejs) /usr/local/bin/node
. $HOME/."$(basename "$SHELL")"rc # recharge le shell
</syntaxhighlight>


sudo ln -s $(which nodejs) /usr/local/bin/node
=== Build ===
. $HOME/."$(basename "$SHELL")"rc # recharge le shell
 
<syntaxhighlight lang="bash">
node make generic


node make generic                                                             
  ### Getting extension build number
  ### Getting extension build number
  Extension build number: 331
  Extension build number: 331
 
  ### Bundling files into build/pdf.js
  ### Bundling files into build/pdf.js
 
  ### Building localization files
  ### Building localization files
 
  ### Creating generic viewer
  ### Creating generic viewer
</syntaxhighlight>


{{PE}}
[[category:Pleade]]
[[category:Pleade]]
[[category:Visionneuse]]
[[category:Visionneuse]]
[[category:PDF]]

Dernière version du 7 mars 2013 à 16:40

Setup testing environnement

[modifier | modifier le wikicode]
 sudo apt-get install nodejs npm
 cd <pleade-entreprise>/src/webapp/theme/js/
 git clone git://github.com/mozilla/pdf.js.git pdfjs

Start Test Server

[modifier | modifier le wikicode]
 cd ./pdfjs/
 nodejs make server

Then you can reach this nodejs server via the following url : http://localhost:8888/web/viewer.html

 http://localhost:8888/web/viewer.html

You can test your own document by placing them into the test/ directory and using URL such as :

 http://localhost:8888/test/your-test-file.pdf

Opening PDF from your website

[modifier | modifier le wikicode]

You need to use the file parameter in the URL whom value is a full encodedURI:

 http://mozilla.github.com/pdf.js/web/viewer.html?file=http%3A%2F%2Fasync5.org%2Fmoz%2Fpdfjs.pdf

Compile the PDF.js

[modifier | modifier le wikicode]

Linux user need to create a symlink from nodejs to node otherwise the build will stall on:

 ### Getting extension build number

On Debian/Ubuntu you can do :

sudo ln -s $(which nodejs) /usr/local/bin/node
. $HOME/."$(basename "$SHELL")"rc # recharge le shell
 node make generic

 ### Getting extension build number
 Extension build number: 331

 ### Bundling files into build/pdf.js

 ### Building localization files

 ### Creating generic viewer