{"id":22451459,"url":"https://github.com/signeasynow/react-pdf-sdk","last_synced_at":"2025-08-02T00:32:23.755Z","repository":{"id":199818288,"uuid":"679492109","full_name":"signeasynow/react-pdf-sdk","owner":"signeasynow","description":"Open Source PDF Editor","archived":false,"fork":false,"pushed_at":"2024-02-01T02:07:17.000Z","size":13598,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-06T06:07:55.904Z","etag":null,"topics":["document-signing","javascript","open-source","pdf-editor","pdf-editor-free","pdf-editor-react","pdf-sign","react","self-hosted","signing"],"latest_commit_sha":null,"homepage":"https://www.signeasynow.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/signeasynow.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}},"created_at":"2023-08-17T01:15:00.000Z","updated_at":"2024-11-01T02:21:07.000Z","dependencies_parsed_at":"2023-12-15T00:23:49.231Z","dependency_job_id":"500f1e50-79ab-42b6-89a4-a1530d45c341","html_url":"https://github.com/signeasynow/react-pdf-sdk","commit_stats":null,"previous_names":["prodfox-pdf/react-ui-plugin","alien35/pdf-react-plugin","smartpricedoc/react-pdf-editor","signeasynow/react-pdf-editor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signeasynow%2Freact-pdf-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signeasynow%2Freact-pdf-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signeasynow%2Freact-pdf-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signeasynow%2Freact-pdf-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/signeasynow","download_url":"https://codeload.github.com/signeasynow/react-pdf-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228419607,"owners_count":17916772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["document-signing","javascript","open-source","pdf-editor","pdf-editor-free","pdf-editor-react","pdf-sign","react","self-hosted","signing"],"created_at":"2024-12-06T06:08:01.473Z","updated_at":"2024-12-06T06:08:02.516Z","avatar_url":"https://github.com/signeasynow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React PDF Editor\n\nView, edit, and Chat-with-your-PDF with AI.\n\nAdd View to your app for free. Learn pricing for all features [here](https://www.signeasynow.com/upgrade)\n\n![Visual of app](https://media.discordapp.net/attachments/1065627273618800732/1161792368152956938/Feature_rich_React_component_for_viewing_editing_and_more.png?ex=65399675\u0026is=65272175\u0026hm=3ccb739e31aa1b1604b9e566a9556d8431c5ed3944df3bdb065f83317aec768d\u0026=\u0026width=1884\u0026height=942)\n\n# Demo\n\nhttps://www.signeasynow.com/edit-your-pdf\n\nWant to see the source code for the above demo? Find it [here](https://github.com/signeasynow/react-pdf-demo).\n\n# Quick start\n\n1. Copy-paste the `pdf-ui` folder [here](https://github.com/signeasynow/react-pdf-demo/tree/main/public/pdf-ui) into your own `public` folder.\n\n1. Install\n\n`npm install --save @prodfox/react-pdf-editor`\n\nor\n\n`yarn add @prodfox/react-pdf-editor`\n\n3. Create a component\n```\nimport { useRef } from 'react';\nimport { useCreateIframeAndLoadViewer } from \"@prodfox/react-pdf-editor\";\n\nfunction App() {\n  const containerRef = useRef(null);\n\n  const { download } = useCreateIframeAndLoadViewer({\n    container: containerRef,\n    licenseKey: \"sandbox\",\n    locale: \"en\",\n    tools: {\n      editing: [\n       \"extract\",\n       \"remove\",\n        \"move\"\n      ],\n      thumbnails: [\n        \"zoom\",\n        \"expand\"\n      ],\n      general: [\n        \"thumbnails\",\n        \"download\",\n        \"search\",\n        \"panel-toggle\",\n        \"zoom\"\n      ],\n    },\n    files: [\n      {\n        url: \"https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf\",\n        name: \"my-file1.pdf\"\n      },\n      {\n        url: \"https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf\",\n        name: \"my-file2.pdf\"\n      }\n    ],\n  });\n\n\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={download}\u003eDownload\u003c/button\u003e\n      \u003cdiv className=\"container\" id=\"pdf\" ref={containerRef}\u003e\n    \u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\n## Core\n\n## Parameters\n\n### container `Required`\n\nThe HTML element to attach the PDF viewer to.\n\n### tools `Object` `{}`\n\nControl what tools are available in the UI. Available keys are `thumbnails`, `general`, `editing`, ...\n\n```\nuseCreateIframeAndLoadViewer({\n  tools: {\n    thumbnails: ...,\n    general: ...,\n    editing: ...,\n  },\n  ...other parameters\n});\n```\n\n#### general `Object` `[]`\n\n| Field   | Description      |\n| ------- | ---------------- |\n| zoom | Enable zoom in/out of the document in view |\n| search | Enable search functions |\n| download | Enable downloading the document |\n| thumbnails | Enable a thumbnails panel |\n| panel-toggle | Enable the left-side panel to be togglable |\n| chat | Enable AI conversations with your PDF (user ID is required after 10 questions) |\n\n```\nuseCreateIframeAndLoadViewer({\n  tools: {\n    general: [\n      \"zoom\",\n      \"search\",\n      \"download\",\n      \"thumbnails\",\n      \"panel-toggle\"\n    ],\n  },\n  ...other parameters\n});\n```\n\n#### thumbnails `Object` `[]`\n\n| Field   | Description      |\n| ------- | ---------------- |\n| zoom | Enable a slider above thumbnails to increase/decrease the size of the thumbnails |\n| expand | Enable the thumbnails bar to be expandable to the full screen |\n\n\n```\nuseCreateIframeAndLoadViewer({\n  tools: {\n    thumbnails: [\n      \"zoom\",\n      \"expand\"\n    ],\n  },\n  ...other parameters\n});\n```\n\n#### editing `Object` `[]`\n\n| Field   | Description      |\n| ------- | ---------------- |\n| remove | Enable the ability to remove pages |\n| rotation | Enable the rotation of individual pages |\n| extraction | Enabling extracting out a set of pages into one document |\n| move | Re-arrange pages in a document |\n\n```\nuseCreateIframeAndLoadViewer({\n  tools: {\n    editing: [\n      \"remove\",\n      \"rotation\",\n      \"extraction\",\n      \"move\"\n    ],\n  },\n  ...other parameters\n});\n```\n\n#### locale `string` `en` `Optional`\n\nOptions:\n\n`en` - English\n\n`es` - Spanish\n\n`ru` - Russian\n\n(Reach out if you need a particular language added)\n\n#### onFileFailed `Function` `optional`\n\nCallback when a file fails to upload\n\n```\nuseCreateIframeAndLoadViewer({\n  onFileFailed: (errorMessage) =\u003e {\n    // handle the failure as you need\n  }\n});\n```\n\n#### mode `string` `optional`\n\nDefaults to `regular`. Set it to `split` to enable being able to select split markers to be then used for splitting a document into several documents.\n\n# Functions\n\nCombine several files into one\n\n```\nconst { combineFiles } = useCreateIframeAndLoadViewer({\n  ...\n});\n\ncombineFiles();\n\n```\n\nListen for when the pages are loaded for the active document\n\n```\nconst { pagesLoaded } = useCreateIframeAndLoadViewer({\n  ...\n});\n\nif (pagesLoaded) {\n  // logic here\n}\n```\n\nDownload\n\n```\nconst { download } = useCreateIframeAndLoadViewer({\n  ...\n});\n\ndownload();\n```\n\nListen for when the PDF editor is ready to accept commands\n\n```\nconst { isReady } = useCreateIframeAndLoadViewer({\n  ...\n});\n\nif (isReady) {\n  // logic here\n}\n```\n\nToggle displaying the full screen thumbnail view\n\n```\nconst { toggleFullScreenThumbnails } = useCreateIframeAndLoadViewer({\n  ...\n});\n\ntoggleFullScreenThumbnails(true) // set this to true or false to open/close it.\n```\n\nControl the thumbnail zoom level. Ranges from 0 to 1.\n\n```\nconst { setThumbnailZoom } = useCreateIframeAndLoadViewer({\n  ...\n});\n\nsetThumbnailZoom(0.5)\n```\n\nToggle displaying the search bar on the right\n\n```\nconst { toggleSearchbar } = useCreateIframeAndLoadViewer({\n  ...\n});\n\ntoggleSearchbar(true) // set this to true or false to open/close it.\n```\n\nDelete the AI conversation chat history\n\n```\nconst { removeChatHistory } = useCreateIframeAndLoadViewer({\n  ...\n});\n\nremoveChatHistory()\n```\n\nGet the 0-indexed array of selected pages\n\n```\nconst { selectedPages } = useCreateIframeAndLoadViewer({\n  ...\n});\n```\n\nExtract the selected pages\n\n```\nconst { extractPages } = useCreateIframeAndLoadViewer({\n  ...\n});\n\nextractPages()\n```\n\nSplit the document into several documents based on the split markers the user selected.\n\n```\nconst { splitPages } = useCreateIframeAndLoadViewer({\n  ...\n});\n\nsplitPages()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigneasynow%2Freact-pdf-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigneasynow%2Freact-pdf-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigneasynow%2Freact-pdf-sdk/lists"}