{"id":51043548,"url":"https://github.com/qoretechnologies/module-pdf","last_synced_at":"2026-06-22T12:01:43.013Z","repository":{"id":333833963,"uuid":"1132272212","full_name":"qoretechnologies/module-pdf","owner":"qoretechnologies","description":"Qore PDF module for reading, writing, and editing PDF files","archived":false,"fork":false,"pushed_at":"2026-06-05T18:15:14.000Z","size":3683,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-06-05T20:09:04.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"QuakeC","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qoretechnologies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-11T16:48:48.000Z","updated_at":"2026-06-05T18:15:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"d58d2cdf-fa73-48f5-8d8f-bbb4d6bd4c9e","html_url":"https://github.com/qoretechnologies/module-pdf","commit_stats":null,"previous_names":["qoretechnologies/module-pdf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qoretechnologies/module-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qoretechnologies","download_url":"https://codeload.github.com/qoretechnologies/module-pdf/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34647750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-22T12:01:41.975Z","updated_at":"2026-06-22T12:01:43.006Z","avatar_url":"https://github.com/qoretechnologies.png","language":"QuakeC","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qore PDF Module\n\n## Introduction\n\nThe `pdf` module provides PDF creation, reading, editing, and rendering support\nfor Qore using QPDF and PoDoFo, with optional PDFium integration for rendering\nand text extraction.\n\n## Requirements\n\n- Qore 2.0+\n- CMake 3.5+\n- C++17 compiler\n- QPDF (required)\n- PoDoFo (required; bundled by default)\n- PDFium (optional; required in Qorus CI)\n\n## OS Packages\n\nThe bundled PoDoFo build requires common graphics/font libraries. Install these\npackages before building. PDFium is optional; there is no MacPorts PDFium port.\n\nUbuntu:\n\n```bash\nsudo apt-get update\nsudo apt-get install -y \\\n  cmake pkg-config qpdf libqpdf-dev libfreetype-dev \\\n  libssl-dev libxml2-dev libfontconfig1-dev libpng-dev \\\n  libjpeg-turbo8-dev libtiff-dev zlib1g-dev\n```\n\nPDFium (optional): not packaged in standard Ubuntu repos; provide a prebuilt\n`libpdfium` and pass `-DENABLE_PDFIUM=ON -DPDFIUM_INCLUDE_DIR=... -DPDFIUM_LIBRARY=...`,\nor use `-DENABLE_PDFIUM=OFF`.\n\nAlpine:\n\n```bash\nsudo apk add --no-cache \\\n  cmake pkgconfig qpdf qpdf-dev freetype-dev \\\n  openssl-dev libxml2-dev fontconfig-dev libpng-dev \\\n  libjpeg-turbo-dev tiff-dev zlib-dev\n```\n\nPDFium (optional): not in Alpine repos; provide a prebuilt `libpdfium` and pass\n`-DENABLE_PDFIUM=ON -DPDFIUM_INCLUDE_DIR=... -DPDFIUM_LIBRARY=...`,\nor use `-DENABLE_PDFIUM=OFF`.\n\nFedora:\n\n```bash\nsudo dnf install -y \\\n  cmake pkgconf-pkg-config qpdf qpdf-devel freetype-devel \\\n  openssl-devel libxml2-devel fontconfig-devel libpng-devel \\\n  libjpeg-turbo-devel libtiff-devel zlib-devel\n```\n\nMacPorts (no PDFium port available):\n\n```bash\nsudo port install \\\n  cmake pkgconfig qpdf freetype openssl3 libxml2 fontconfig libpng \\\n  libjpeg-turbo tiff zlib\n```\n\n## Building\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\nmake install\n```\n\nTo use the system PoDoFo instead of the bundled source:\n\n```bash\ncmake .. -DUSE_BUNDLED_PODOFO=OFF\n```\n\nTo disable PDFium features:\n\n```bash\ncmake .. -DENABLE_PDFIUM=OFF\n```\n\n## Quick Start\n\n```qore\n#!/usr/bin/qore\n\n%requires pdf\n\n# Create a PDF with two blank pages\nPdfWriter writer();\nwriter.addBlankPage();\nwriter.addBlankPage();\nwriter.save(\"example.pdf\");\n\n# Read metadata and page count\nPdfReader reader(\"example.pdf\");\nint pages = reader.pageCount();\n\n# Merge PDFs\nPdfDocument merged = PdfDocument::merge((\"example.pdf\", \"example.pdf\"));\nmerged.save(\"merged.pdf\");\n```\n\n## Adding Images and Text\n\nThe `PdfEditor` class allows adding images and styled text to existing PDFs:\n\n```qore\n%requires pdf\n\n# Add an image to a PDF\nPdfEditor editor(\"document.pdf\");\neditor.drawImage(0, \"logo.png\", 100.0, 700.0, 200.0, 100.0);\neditor.save(\"with_logo.pdf\");\n\n# Add styled text\nhash\u003cauto\u003e style = {\n    \"font\": {\"family\": \"Helvetica\", \"size\": 24.0, \"bold\": True},\n    \"color\": {\"hex\": \"#FF0000\"},\n};\neditor.drawText(0, \"Hello World\", 100.0, 500.0, style);\neditor.save(\"with_text.pdf\");\n```\n\n## Data Provider\n\nThe module includes a PDF data provider for integration with Qore's data\nprovider framework.\n\n```qore\n%requires PdfDataProvider\n\nAbstractDataProvider dp = DataProvider::getFactoryObjectFromStringEx(\"pdf{}/document/merge\");\n\nhash\u003cauto\u003e result = dp.doRequest({\n    \"output_path\": \"merged.pdf\",\n    \"inputs\": (\"a.pdf\", \"b.pdf\"),\n});\n```\n\nExample `qdp` actions:\n\n```bash\n# Document operations\nqdp 'pdf{}/document/create' output_path=out.pdf,page_count=2\nqdp 'pdf{}/document/metadata' input_path=in.pdf,output_path=out.pdf,metadata='{\"title\":\"Updated\"}'\nqdp 'pdf{}/document/rotate' input_path=in.pdf,output_path=rotated.pdf,pages='(0)',degrees=90\nqdp 'pdf{}/document/merge' inputs='(\"a.pdf\",\"b.pdf\")',output_path=merged.pdf\n\n# Add images to pages\nqdp 'pdf{}/document/add-image' input_path=in.pdf,output_path=out.pdf,image='{\"image_path\":\"logo.png\",\"position\":{\"preset\":\"center\"}}'\n\n# Add styled text\nqdp 'pdf{}/document/add-text' input_path=in.pdf,output_path=out.pdf,text='{\"text\":\"Hello\",\"position\":{\"x\":100,\"y\":100}}'\n\n# Add watermarks (text or image)\nqdp 'pdf{}/document/add-watermark' input_path=in.pdf,output_path=out.pdf,watermark='{\"type\":\"text\",\"text\":\"DRAFT\",\"opacity\":0.3}'\n\n# Add signature fields\nqdp 'pdf{}/document/add-signature-field' input_path=in.pdf,output_path=out.pdf,signature='{\"label\":\"Signature\"}'\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\nThis project bundles PoDoFo (LGPL-2.0-or-later). See\n`third_party/podofo/COPYING` for details.\n\n## Copyright\n\nCopyright 2026 Qore Technologies, s.r.o.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqoretechnologies%2Fmodule-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqoretechnologies%2Fmodule-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqoretechnologies%2Fmodule-pdf/lists"}