diff --git a/printable.module b/printable.module
index 666ff69..013e2cf 100755
--- a/printable.module
+++ b/printable.module
@@ -161,7 +161,7 @@ function template_preprocess_printable_footer(array &$variables) {
   $source_url = \Drupal::service('path.current')->getPath();
   $pos = strpos($source_url, "printable");
   $source_url = substr($source_url, 0, $pos - 1);
-  $source_url = $base_url . \Drupal::service('path.alias_manager')->getAliasByPath($source_url);
+  $source_url = $base_url . \Drupal::service('path_alias.manager')->getAliasByPath($source_url);
   $variables['source_url'] = $source_url;
   if (\Drupal::service('config.factory')->get('printable.settings')->get('list_attribute')) {
     $links = $variables['footer_content'];
@@ -220,7 +220,7 @@ function printable_entity_view(array &$build, EntityInterface $entity, EntityVie
 
     // Add the build links to the entity being rendered.
     $build['printable_navigation'] = [
-      '#markup' => '<strong class="node_view">' . drupal_render($printable_navigation) . '</strong>',
+      '#markup' => '<strong class="node_view">' . \Drupal::service('renderer')->render($printable_navigation) . '</strong>',
       '#attached' => [
         'library' => [ 'printable/entity-links' ],
       ],
diff --git a/src/Controller/PrintableController.php b/src/Controller/PrintableController.php
index 3d1eaa1..90750d8 100644
--- a/src/Controller/PrintableController.php
+++ b/src/Controller/PrintableController.php
@@ -66,7 +66,7 @@ class PrintableController extends ControllerBase implements ContainerInjectionIn
   public function showFormat(EntityInterface $entity, $printable_format) {
     if ($this->printableFormatManager->getDefinition($printable_format)) {
       $format = $this->printableFormatManager->createInstance($printable_format);
-      $content = $this->entityManager()->getViewBuilder($entity->getEntityTypeId())->view($entity, 'printable');
+      $content = \Drupal::service('entity_type.manager')->getViewBuilder($entity->getEntityTypeId())->view($entity, 'printable');
       $format->setContent($content);
       return $format->getResponse();
     }
diff --git a/src/Form/FormatConfigurationFormPdf.php b/src/Form/FormatConfigurationFormPdf.php
index 4ccd728..e3cd7e5 100644
--- a/src/Form/FormatConfigurationFormPdf.php
+++ b/src/Form/FormatConfigurationFormPdf.php
@@ -77,7 +77,7 @@ class FormatConfigurationFormPdf extends FormBase {
       ];
     }
     else {
-      drupal_set_message($this->t('You are seeing no PDF generating tool because you have not installed any third party library using composer.'));
+      $this->messenger()->addStatus($this->t('You are seeing no PDF generating tool because you have not installed any third party library using composer.'));
     }
     if ($mpdf_present) {
       $form['settings']['print_pdf_pdf_tool']['#options'] += ['mPDF' => 'mPDF'];
@@ -233,7 +233,7 @@ class FormatConfigurationFormPdf extends FormBase {
         ->set('path_to_xfb_run', $form_state->getValue('path_to_xfb_run'))
         ->save();
     }
-    drupal_set_message('The configuration option has been saved','status');
+    $this->messenger()->addStatus('The configuration option has been saved');
   }
 
 }
diff --git a/src/Form/FormatConfigurationFormPrint.php b/src/Form/FormatConfigurationFormPrint.php
index 95f3190..42eff9a 100644
--- a/src/Form/FormatConfigurationFormPrint.php
+++ b/src/Form/FormatConfigurationFormPrint.php
@@ -100,7 +100,7 @@ class FormatConfigurationFormPrint extends FormBase {
       ->set('close_window', $form_state->getValue('print_html_windowclose'))
       ->set('list_attribute', $form_state->getValue('print_html_display_sys_urllist'))
       ->save();
-    drupal_set_message('The configuration option has been saved','status');
+    $this->messenger()->addStatus('The configuration option has been saved');
   }
 
 }
diff --git a/src/Form/LinksConfigurationForm.php b/src/Form/LinksConfigurationForm.php
index dd699cc..b7f330e 100644
--- a/src/Form/LinksConfigurationForm.php
+++ b/src/Form/LinksConfigurationForm.php
@@ -95,7 +95,7 @@ class LinksConfigurationForm extends FormBase {
     $this->configFactory->getEditable('printable.settings')
       ->set('printable_print_link_locations', $form_state->getValue('print_print_link_pos'))
       ->save();
-    drupal_set_message('The configuration option has been saved','status');
+    $this->messenger()->addStatus('The configuration option has been saved');
   }
 
 }
diff --git a/src/Form/PdfLinksConfigurationForm.php b/src/Form/PdfLinksConfigurationForm.php
index 9e6ee89..95a0d43 100644
--- a/src/Form/PdfLinksConfigurationForm.php
+++ b/src/Form/PdfLinksConfigurationForm.php
@@ -95,7 +95,7 @@ class PdfLinksConfigurationForm extends FormBase {
     $this->configFactory->getEditable('printable.settings')
       ->set('printable_pdf_link_locations', $form_state->getValue('print_pdf_link_pos'))
       ->save();
-    drupal_set_message('The configuration option has been saved','status');
+    $this->messenger()->addStatus('The configuration option has been saved');
   }
 
 }
diff --git a/src/Tests/PrintableLinkTest.php b/src/Tests/PrintableLinkTest.php
index 5e0dad8..dddf58c 100644
--- a/src/Tests/PrintableLinkTest.php
+++ b/src/Tests/PrintableLinkTest.php
@@ -45,7 +45,7 @@ class PrintableLinkTest extends NodeTestBase {
     $this->drupalGet('admin/config/user-interface/printable/pdf');
     $this->assertResponse(200);
 
-    $node_type_storage = \Drupal::entityManager()->getStorage('node_type');
+    $node_type_storage = \Drupal::service('entity_type.manager')->getStorage('node_type');
 
     // Test /node/add page with only one content type.
     $node_type_storage->load('article')->delete();
diff --git a/src/Tests/PrintablePageTest.php b/src/Tests/PrintablePageTest.php
index c28c953..253db4a 100644
--- a/src/Tests/PrintablePageTest.php
+++ b/src/Tests/PrintablePageTest.php
@@ -42,7 +42,7 @@ class PrintablePageTest extends NodeTestBase {
    */
   public function testCustomPageExists() {
     global $base_url;
-    $node_type_storage = \Drupal::entityManager()->getStorage('node_type');
+    $node_type_storage = \Drupal::service('entity_type.manager')->getStorage('node_type');
 
     // Test /node/add page with only one content type.
     $node_type_storage->load('article')->delete();
diff --git a/src/Tests/PrintablePdfTest.php b/src/Tests/PrintablePdfTest.php
index b356190..ca16822 100644
--- a/src/Tests/PrintablePdfTest.php
+++ b/src/Tests/PrintablePdfTest.php
@@ -50,7 +50,7 @@ class PrintablePdfTest extends NodeTestBase {
    */
   public function testCustomPageExists() {
     global $base_url;
-    $node_type_storage = \Drupal::entityManager()->getStorage('node_type');
+    $node_type_storage = \Drupal::service('entity_type.manager')->getStorage('node_type');
 
     // Test /node/add page with only one content type.
     $node_type_storage->load('article')->delete();
diff --git a/src/Tests/PrintableUninstallTest.php b/src/Tests/PrintableUninstallTest.php
index e5e4dc6..2189e71 100644
--- a/src/Tests/PrintableUninstallTest.php
+++ b/src/Tests/PrintableUninstallTest.php
@@ -35,7 +35,7 @@ class PrintableUninstallTest extends NodeTestBase {
    * Tests that the node/{node}/printable/print path returns the right content.
    */
   public function testCustomPageExists() {
-    $node_type_storage = \Drupal::entityManager()->getStorage('node_type');
+    $node_type_storage = \Drupal::service('entity_type.manager')->getStorage('node_type');
 
     // Test /node/add page with only one content type.
     $node_type_storage->load('article')->delete();
diff --git a/tests/src/Unit/Plugin/Block/PrintableLinkBlockTest.php b/tests/src/Unit/Plugin/Block/PrintableLinkBlockTest.php
index 9badc39..7521d86 100644
--- a/tests/src/Unit/Plugin/Block/PrintableLinkBlockTest.php
+++ b/tests/src/Unit/Plugin/Block/PrintableLinkBlockTest.php
@@ -54,7 +54,7 @@ class PrintableLinkBlockTest extends UnitTestCase {
       ->will($this->returnSelf());
     $routematch->expects($this->exactly(2))
       ->method('getParameter')
-      ->will($this->returnValue($this->getMock('Drupal\Core\Entity\EntityInterface')));
+      ->will($this->returnValue($this->createMock('Drupal\Core\Entity\EntityInterface')));
     $links = [
       'title' => 'Print',
       'url' => '/foo/1/printable/print',
diff --git a/tests/src/Unit/PrintableEntityManagerTest.php b/tests/src/Unit/PrintableEntityManagerTest.php
index 1b441b3..a2177ce 100644
--- a/tests/src/Unit/PrintableEntityManagerTest.php
+++ b/tests/src/Unit/PrintableEntityManagerTest.php
@@ -36,7 +36,7 @@ class PrintableEntityManagerTest extends UnitTestCase {
     $entity_definition->expects($this->any())
       ->method('hasHandlerClass')
       ->will($this->returnValue(TRUE));
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->createMock('Drupal\Core\Entity\EntityManagerInterface');
     $entity_manager->expects($this->once())
       ->method('getDefinitions')
       ->will($this->returnValue([
diff --git a/tests/src/Unit/PrintableLinkBuilderTest.php b/tests/src/Unit/PrintableLinkBuilderTest.php
index 5aab558..29298fc 100644
--- a/tests/src/Unit/PrintableLinkBuilderTest.php
+++ b/tests/src/Unit/PrintableLinkBuilderTest.php
@@ -52,7 +52,7 @@ class PrintableLinkBuilderTest extends UnitTestCase {
 
     $link_builder = new PrintableLinkBuilder($config, $printable_manager);
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->createMock('Drupal\Core\Entity\EntityInterface');
     $entity->expects($this->exactly(2))
       ->method('getEntityTypeId')
       ->will($this->returnValue($entity_type));
