diff --git a/pdf.links.menu.yml b/pdf.links.menu.yml
new file mode 100644
index 0000000..22236de
--- /dev/null
+++ b/pdf.links.menu.yml
@@ -0,0 +1,6 @@
+pdf.config_form:
+  title: 'PDF.js'
+  route_name: pdf.config_form
+  description: 'Configuration for the PDF module.'
+  parent: system.admin_config_media
+  weight: 99
diff --git a/pdf.routing.yml b/pdf.routing.yml
new file mode 100644
index 0000000..1291183
--- /dev/null
+++ b/pdf.routing.yml
@@ -0,0 +1,9 @@
+pdf.config_form:
+  path: '/admin/config/media/pdfjs'
+  defaults:
+    _form: '\Drupal\pdf\Form\ConfigForm'
+    _title: 'PDF.js Configuration'
+  requirements:
+    _permission: 'access administration pages'
+  options:
+    _admin_route: TRUE
diff --git a/src/Form/ConfigForm.php b/src/Form/ConfigForm.php
new file mode 100644
index 0000000..12b9fe1
--- /dev/null
+++ b/src/Form/ConfigForm.php
@@ -0,0 +1,56 @@
+<?php
+
+namespace Drupal\pdf\Form;
+
+use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Class ConfigForm.
+ */
+class ConfigForm extends ConfigFormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEditableConfigNames() {
+    return [
+      'pdf.config',
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'config_form';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $config = $this->config('pdf.config');
+    $form['custom_viewer'] = [
+      '#type' => 'textfield',
+      '#title' => $this->t('Path to custom viewer.html file'),
+      '#description' => $this->t('Specify a custom viewer.html file. If left empty, the default viewer.html file will be used.'),
+      '#maxlength' => 255,
+      '#size' => 64,
+      '#default_value' => $config->get('custom_viewer'),
+    ];
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    parent::submitForm($form, $form_state);
+
+    $this->config('pdf.config')
+      ->set('custom_viewer', $form_state->getValue('custom_viewer'))
+      ->save();
+  }
+
+}
diff --git a/src/Plugin/Field/FieldFormatter/PdfDefault.php b/src/Plugin/Field/FieldFormatter/PdfDefault.php
index e81a440..73f85a5 100755
--- a/src/Plugin/Field/FieldFormatter/PdfDefault.php
+++ b/src/Plugin/Field/FieldFormatter/PdfDefault.php
@@ -136,7 +136,7 @@ class PdfDefault extends FormatterBase {
       $summary[] = $this->t('No settings');
     }
     else {
-      $summary[] = $this->t('Use pdf.js even users have PDF reader plugin: @keep_pdfjs', ['@keep_pdfjs' => $keep_pdfjs ? t('Yes') : t('No')]) . '. ' . t('Width: @width , Height: @height', [
+      $summary[] = $this->t('Use pdf.js even when users have PDF reader plugin: @keep_pdfjs', ['@keep_pdfjs' => $keep_pdfjs ? t('Yes') : t('No')]) . '. ' . t('Width: @width , Height: @height', [
         '@width' => $width,
         '@height' => $height,
       ]);
@@ -149,6 +149,9 @@ class PdfDefault extends FormatterBase {
    * {@inheritdoc}
    */
   public function viewElements(FieldItemListInterface $items, $langcode) {
+
+    $config = \Drupal::config('pdf.config');
+    $viewer_path = $config->get('custom_viewer') ? $config->get('custom_viewer') : '/libraries/pdf.js/web/viewer.html';
     $elements = [];
     $keep_pdfjs = $this->getSetting('keep_pdfjs');
     $extra_options = array_filter(array_intersect_key($this->getSettings(), array_flip([
@@ -165,7 +168,7 @@ class PdfDefault extends FormatterBase {
     foreach ($items as $delta => $item) {
       if ($item->entity->getMimeType() == 'application/pdf') {
         $file_url = file_create_url($item->entity->getFileUri());
-        $iframe_src = file_create_url(base_path() . 'libraries/pdf.js/web/viewer.html') . '?file=' . rawurlencode($file_url);
+        $iframe_src = file_create_url($viewer_path) . '?file=' . rawurlencode($file_url);
         $iframe_src = !empty($query) && $keep_pdfjs ? $iframe_src . '#' . $query : $iframe_src;
         $html = [
           '#theme' => 'file_pdf',
