<commit_before>[![Build Status](https://travis-ci.org/mohanraj-ramanujam/pdfjs.svg?branch=master)](https://travis-ci.org/mohanraj-ramanujam/pdfjs)

### PDFJS Information

PDFJS is a RAILS ENGINE plugin for integrating the PDFJS into the RAILS applications.

* Is a RAILS ENGINE;
* Is composing of PDFJS images, javascripts and stylesheets;
* Is contains PDFJS HTML layout;

### How To Integrate with RAILS application

* Create a separate controller inherited from Pdfjs::PdfjsController

  ```ruby
  class PDFController < PdfjsController
  end
  ```
* Define your action. EX: show.

  ```ruby
  class PDFController < PdfjsController
    def show
      @pdfjs_file = 'http://yoursite.com/pdfjs.pdf'
    end
  end
  ```
* Create the show template and set the PDF file path

  ```html
  <%= content_for :pdfjs do %>
    <%= javascript_tag do %>
      window.DEFAULT_URL = '<%= @pdfjs_file.html_safe %>';
    <% end %>
  <% end %>
  ```

### Example applications

* https://github.com/mohanraj-ramanujam/pdfjs<commit_msg>Markdown formatting.<commit_after>[![Build Status](https://travis-ci.org/mohanraj-ramanujam/pdfjs.svg?branch=master)](https://travis-ci.org/mohanraj-ramanujam/pdfjs)

### PDFJS Information

PDFJS is a RAILS ENGINE plugin for integrating the PDFJS into the RAILS applications.

* Is a RAILS ENGINE;
* Is composing of PDFJS images, javascripts and stylesheets;
* Is contains PDFJS HTML layout;

### How To Integrate with RAILS application

* Create a separate controller inherited from Pdfjs::PdfjsController

```ruby
class PDFController < PdfjsController
end
```
* Define your action. EX: show.

```ruby
class PDFController < PdfjsController
  def show
    @pdfjs_file = 'http://yoursite.com/pdfjs.pdf'
  end
end
```
* Create the show template and set the PDF file path

```html
<%= content_for :pdfjs do %>
  <%= javascript_tag do %>
    window.DEFAULT_URL = '<%= @pdfjs_file.html_safe %>';
  <% end %>
<% end %>
```

### Example applications

* https://github.com/mohanraj-ramanujam/pdfjs
{'fraction_non_alphanumeric': 0.12506228201295466, 'fraction_numerical': 0.0, 'mean_word_length': 4.188630490956072, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6361193', 'n_tokens_mistral': 712, 'n_tokens_neox': 655, 'n_words': 182}