diff --git a/documentation_generator.info.yml b/documentation_generator.info.yml
index 273a5e9..c2c5a01 100644
--- a/documentation_generator.info.yml
+++ b/documentation_generator.info.yml
@@ -1,7 +1,7 @@
 name: Documentation generator
 description: Allows administrators to generate documentation describing site features.
 type: module
-core_version_requirement: ^8.8 || ^9
+core_version_requirement: ^9.3 || ^10
 
 # Information added by Drupal.org packaging script on 2022-01-09
 version: '2.0.4'
diff --git a/src/Plugin/DocumentationGeneratorRender/PDF.php b/src/Plugin/DocumentationGeneratorRender/PDF.php
index 22ec6d3..bb4dbf0 100644
--- a/src/Plugin/DocumentationGeneratorRender/PDF.php
+++ b/src/Plugin/DocumentationGeneratorRender/PDF.php
@@ -74,13 +74,13 @@ class PDF extends DocumentationGeneratorRenderBase implements ContainerFactoryPl
       '#groups' => $groups,
     ];
 
-    $this->dompdf->loadHtml(render($build));
+    $this->dompdf->loadHtml(\Drupal::service('renderer')->render($build));
     $this->dompdf->render();
     $output = $this->dompdf->output();
 
     $success = TRUE;
     try {
-      file_save_data($output, 'private://' . $fileName);
+      \Drupal::service('file.repository')->writeData($output, 'private://' . $fileName);
     }
     catch (FileException $e) {
       $success = FALSE;
