{"library":"pypdf4","title":"PyPDF4","description":"PyPDF4 is a pure-Python PDF toolkit capable of splitting, merging, cropping, and transforming PDF files. Current version is 1.27.0. The library is in maintenance mode with slow updates.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pypdf4"],"cli":null},"imports":["from PyPDF4 import PdfFileReader"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from PyPDF4 import PdfFileReader, PdfFileWriter\n\n# Read a PDF\nreader = PdfFileReader(open('example.pdf', 'rb'))\nprint(f\"Number of pages: {reader.numPages}\")\n\n# Write a PDF\nwriter = PdfFileWriter()\nwriter.addPage(reader.getPage(0))\nwith open('output.pdf', 'wb') as f:\n    writer.write(f)","lang":"python","description":"Basic example: read a PDF and write its first page to a new file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}