code: def test_2238():
      filepath = f"{scriptdir}/resources/test2238.pdf"
      doc = fitz.open(filepath)
  
      first_page = doc.load_page(0).get_text(
          "text", fitz.INFINITE_RECT()
      )
      last_page = doc.load_page(-1).get_text(
          "text", fitz.INFINITE_RECT()
      )
  
      print(f"first_page={first_page!r}")
      print(f"last_page={last_page!r}")
      assert first_page == "Hello World\n"
      assert last_page == "Hello World\n"
  
      first_page = doc.load_page(0).get_text("text")
      last_page = doc.load_page(-1).get_text("text")
  
      print(f"first_page={first_page!r}")
      print(f"last_page={last_page!r}")
      assert first_page == "Hello World\n"
      assert last_page == "Hello World\n"
  
imports: import io
  import os
  import fitz
  import pickle
label_desc: Use image node_id 31 for calling a global function with example usage: test_2238() without return types