
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@prodfox/react-pdf-editor
Advanced tools
View, edit, and Chat-with-your-PDF with AI.
Add View to your app for free. Learn pricing for all features here

https://www.signeasynow.com/edit-your-pdf
Want to see the source code for the above demo? Find it here.
Copy-paste the pdf-ui folder here into your own public folder.
Install
npm install --save @prodfox/react-pdf-editor
or
yarn add @prodfox/react-pdf-editor
import { useRef } from 'react';
import { useCreateIframeAndLoadViewer } from "@prodfox/react-pdf-editor";
function App() {
const containerRef = useRef(null);
const { download } = useCreateIframeAndLoadViewer({
container: containerRef,
licenseKey: "sandbox",
locale: "en",
tools: {
editing: [
"extract",
"remove",
"move"
],
thumbnails: [
"zoom",
"expand"
],
general: [
"thumbnails",
"download",
"search",
"panel-toggle",
"zoom"
],
},
files: [
{
url: "https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf",
name: "my-file1.pdf"
},
{
url: "https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf",
name: "my-file2.pdf"
}
],
});
return (
<div>
<button onClick={download}>Download</button>
<div className="container" id="pdf" ref={containerRef}>
</div>
</div>
);
}
export default App;
RequiredThe HTML element to attach the PDF viewer to.
Object {}Control what tools are available in the UI. Available keys are thumbnails, general, editing, ...
useCreateIframeAndLoadViewer({
tools: {
thumbnails: ...,
general: ...,
editing: ...,
},
...other parameters
});
Object []| Field | Description |
|---|---|
| zoom | Enable zoom in/out of the document in view |
| search | Enable search functions |
| download | Enable downloading the document |
| thumbnails | Enable a thumbnails panel |
| panel-toggle | Enable the left-side panel to be togglable |
| chat | Enable AI conversations with your PDF (user ID is required after 10 questions) |
useCreateIframeAndLoadViewer({
tools: {
general: [
"zoom",
"search",
"download",
"thumbnails",
"panel-toggle"
],
},
...other parameters
});
Object []| Field | Description |
|---|---|
| zoom | Enable a slider above thumbnails to increase/decrease the size of the thumbnails |
| expand | Enable the thumbnails bar to be expandable to the full screen |
useCreateIframeAndLoadViewer({
tools: {
thumbnails: [
"zoom",
"expand"
],
},
...other parameters
});
Object []| Field | Description |
|---|---|
| remove | Enable the ability to remove pages |
| rotation | Enable the rotation of individual pages |
| extraction | Enabling extracting out a set of pages into one document |
| move | Re-arrange pages in a document |
useCreateIframeAndLoadViewer({
tools: {
editing: [
"remove",
"rotation",
"extraction",
"move"
],
},
...other parameters
});
string en OptionalOptions:
en - English
es - Spanish
ru - Russian
(Reach out if you need a particular language added)
Function optionalCallback when a file fails to upload
useCreateIframeAndLoadViewer({
onFileFailed: (errorMessage) => {
// handle the failure as you need
}
});
string optionalDefaults 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.
Combine several files into one
const { combineFiles } = useCreateIframeAndLoadViewer({
...
});
combineFiles();
Listen for when the pages are loaded for the active document
const { pagesLoaded } = useCreateIframeAndLoadViewer({
...
});
if (pagesLoaded) {
// logic here
}
Download
const { download } = useCreateIframeAndLoadViewer({
...
});
download();
Listen for when the PDF editor is ready to accept commands
const { isReady } = useCreateIframeAndLoadViewer({
...
});
if (isReady) {
// logic here
}
Toggle displaying the full screen thumbnail view
const { toggleFullScreenThumbnails } = useCreateIframeAndLoadViewer({
...
});
toggleFullScreenThumbnails(true) // set this to true or false to open/close it.
Control the thumbnail zoom level. Ranges from 0 to 1.
const { setThumbnailZoom } = useCreateIframeAndLoadViewer({
...
});
setThumbnailZoom(0.5)
Toggle displaying the search bar on the right
const { toggleSearchbar } = useCreateIframeAndLoadViewer({
...
});
toggleSearchbar(true) // set this to true or false to open/close it.
Delete the AI conversation chat history
const { removeChatHistory } = useCreateIframeAndLoadViewer({
...
});
removeChatHistory()
Get the 0-indexed array of selected pages
const { selectedPages } = useCreateIframeAndLoadViewer({
...
});
Extract the selected pages
const { extractPages } = useCreateIframeAndLoadViewer({
...
});
extractPages()
Split the document into several documents based on the split markers the user selected.
const { splitPages } = useCreateIframeAndLoadViewer({
...
});
splitPages()
FAQs
## Core
The npm package @prodfox/react-pdf-editor receives a total of 1 weekly downloads. As such, @prodfox/react-pdf-editor popularity was classified as not popular.
We found that @prodfox/react-pdf-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.