{"library":"pydyf","title":"Pydyf","description":"pydyf is a low-level PDF generator written in Python and based on PDF specification 1.7. It provides fine-grained control over PDF features such as bookmarks, attachments, links, color spaces, and text capabilities. The library is actively maintained with frequent releases, typically every 1-3 months.","status":"active","version":"0.12.1","language":"en","source_language":"en","source_url":"https://github.com/CourtBouillon/pydyf","tags":["pdf","generator","low-level","document-generation"],"install":[{"cmd":"pip install pydyf","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"pydyf requires Python 3.10 or newer for the current version.","package":"Python","optional":false}],"imports":[{"symbol":"PDF","correct":"from pydyf import PDF"},{"symbol":"Stream","correct":"from pydyf import Stream"},{"symbol":"Dictionary","correct":"from pydyf import Dictionary"},{"symbol":"Array","correct":"from pydyf import Array"}],"quickstart":{"code":"import pydyf\n\ndocument = pydyf.PDF()\ndraw = pydyf.Stream()\n\n# Set the drawing color to red\ndraw.set_color_rgb(1.0, 0.0, 0.0)\n# Draw a rectangle\ndraw.rectangle(10, 10, 100, 50)\ndraw.fill() # Fill the rectangle\n\n# Add a page with the drawing stream\ndocument.add_page(pydyf.Dictionary({\n    'Type': '/Page',\n    'MediaBox': pydyf.Array([0, 0, 200, 200]),\n    'Contents': draw,\n}))\n\n# Write the PDF to a file\nwith open('output.pdf', 'wb') as f:\n    document.write(f)","lang":"python","description":"This example demonstrates how to create a basic PDF document, draw a red rectangle on a page, and save it to a file using pydyf."},"warnings":[{"fix":"Upgrade your Python environment to version 3.10 or later.","message":"Python 3.8 and 3.9 are no longer supported. Users must upgrade to Python 3.10 or newer.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Refer to the pydyf documentation for alternative, non-deprecated methods for managing colors, shadings, text matrices, and transformations.","message":"Deprecated methods `color_space`, `shading`, `text_matrix`, and `transform` have been removed from `pydyf.Stream`.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Remove the `version` and `identifier` arguments when initializing `pydyf.PDF()`. The constructor now expects only `self` as a positional argument.","message":"The deprecated `version` and `identifier` parameters were removed from `pydyf.PDF.__init__`. Calling `PDF()` with these arguments will now raise a `TypeError`.","severity":"breaking","affected_versions":">=0.11.0"}],"env_vars":null,"last_verified":"2026-04-06T00:00:00.000Z","next_check":"2026-07-05T00:00:00.000Z"}