Gathering detailed insights and metrics for pdf-actions
Gathering detailed insights and metrics for pdf-actions
Gathering detailed insights and metrics for pdf-actions
Gathering detailed insights and metrics for pdf-actions
@lowdefy/actions-pdf-make
Lowdefy action for [pdfmake](http://pdfmake.org).
@elizaos/plugin-pdf
Core Node.js plugin for Eliza OS that provides essential services and actions for file operations, media processing, and cloud integrations.
@sylphide/pdf-actions
A NPM Package built on top of pdf-lib that provides functonalities like merge, rotate, split and many more...
pdf-creation-actions-web-component
component to preview content and print to a pdf
A NPM Package built on top of pdf-lib that provides functonalities like merge, rotate, split,download pdf to disk and many more...
npm install pdf-actions
Typescript
Module System
Node Version
NPM Version
71.6
Supply Chain
97.4
Quality
76
Maintenance
100
Vulnerability
99.3
License
JavaScript (100%)
Total Downloads
58,437
Last Day
3
Last Week
319
Last Month
1,123
Last Year
19,159
MIT License
13 Stars
26 Commits
8 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Dec 14, 2024
Minified
Minified + Gzipped
Latest Version
1.2.2
Package Id
pdf-actions@1.2.2
Unpacked Size
24.36 kB
Size
6.76 kB
File Count
19
NPM Version
8.1.2
Node Version
16.13.2
Cumulative downloads
Total Downloads
Last Day
-62.5%
3
Compared to previous day
Last Week
9.2%
319
Compared to previous week
Last Month
-11.2%
1,123
Compared to previous month
Last Year
5.9%
19,159
Compared to previous year
1
To Modify Esisting PDF Files You Need to First Convert It Into a PDFDocument Object
1import { createFileDoc } from "pdf-actions"; 2 3const EmptyPDFDocument = await createFileDoc.EmptyPDFDocument();
1import { createFileDoc } from "pdf-actions"; 2 3const PDFDocument = await createFileDoc.PDFDocumentFromFile(file); // file is a HTML File Object from input tag
1import { createFileDoc } from "pdf-actions"; 2 3const PDFDocument = await createFileDoc.PDFDocumentFromPDFArray(fileArray); // fileArray is a Unit8Array/ArrayBuffer
1import { pdfArray } from "pdf-actions"; 2 3const PDFArray = await pdfArray(file); // file is a HTML File Object from input tag
1import { pdfArrayToBlob } from "pdf-actions"; 2 3const PDFBlob = await pdfArrayToBlob(fileArray); // fileArray is a Unit8Array
1import { mergePDF } from "pdf-actions"; 2 3const MergedPDFDocument = await mergePDF(filesDocArray); // filesDocArray is a Array of PDFDocument Object
1import { rotatePDF } from "pdf-actions"; 2 3const RotatedPDFDocument = await rotatePDF(fileDoc, degrees); 4/* 5fileDoc is a PDFDocument Object 6degrees is a integer 7*/
1import { splitPDF } from "pdf-actions"; 2 3const SplitPDFDocument = await splitPDF(fileDoc, range, degree); 4/* 5fileDoc is a PDFDocument Object 6range : Page Numbers(both inclusive) is array of two integers - [start,stop] 7degree? is a optional parameter and integer 8*/
1import { breakPDF } from "pdf-actions"; 2 3const BreakPDFDocumentsArray = await breakPDF( 4 fileDoc, 5 pagesInEachFile, 6 haveLastPDF, 7 degree, 8 breakRange 9); 10/* 11fileDoc is a PDFDocument Object 12pagesInEachFile is a integer denoting Number of Pages in Each Broken PDF 13haveLastPDF is a boolean to whether return the last pdf document irrespective of maxPages 14degree? is a optional parameter and integer 15breakRange? is a optional paramenter that is a array of two integers [start,stop] that splits the pdf(both inclisive) before breaking it 16*/
1import { flattenPDFForm } from "pdf-actions"; 2 3const PDFDocumentWithFormsFlattened = await flattenPDFForm(fileDoc); 4/* 5fileDoc is a PDFDocument Object 6*/
1import { resizePDF } from "pdf-actions"; 2 3const PDFDocumentWithFormsFlattened = await resizePDF( 4 fileDoc, 5 size, 6 orientation, 7 position, 8 degree 9); 10/* 11fileDoc is a PDFDocument Object 12size? optional paramenter : string : 2A0 , 4A0 , A[0-10] , B[0-10] , C[0-9] , Executive , Folio , Legal , Letter , RA[0-4] , SR[0-4] , Tabloid 13orientation? optional paramenter : string : Portrait or Landscape 14position? optional parameter - Where The Content Should Be : string : Start , Center , End 15degree? rotate pdf angle : integer 16*/
1import { addMarginPDF } from "pdf-actions"; 2 3const AddedMarginPDFDocument = await addMarginPDF( 4 fileDoc, 5 marginMillimeter, 6 degree 7); 8/* 9fileDoc is a PDFDocument Object 10marginMillimeter? : optional paramenter : array of length 4 11 marginMillimeter[0] -> Left 12 marginMillimeter[1] -> Top 13 marginMillimeter[2] -> Right 14 marginMillimeter[3] -> Bottom 15degree? rotate pdf angle : integer 16*/
1import { editMetaData } from "pdf-actions"; 2 3const NewMetaDataPDFDocument = await editMetaData(fileDoc, options); 4/* 5fileDoc is a PDFDocument Object 6options = {author,title,creator,keywords,documentCreationDate,documentModificationDate,subject,producer} 7*/
1import { removeMetaData } from "pdf-actions"; 2 3const RemovedMetaDataPDFDocument = await removeMetaData(fileDoc); 4/* 5fileDoc is a PDFDocument Object 6*/
1import { addPageNumbers } from "pdf-actions"; 2 3const PDFDocumentWithPageNumbers = await addPageNumbers( 4 fileDoc, 5 pageNumberPosition, 6 margin, 7 startingPage, 8 endingPage, 9 startingNumber, 10 textSize 11); 12/* 13fileDoc is a PDFDocument Object 14pageNumberPosition? : optional : is one of the following string 15 - b-l : Bottom Left 16 - b-c : Bottom Center : Default 17 - b-r : Bottom Right 18 - t-l : Top Left 19 - t-c : Top Center 20 - t-r : Top Right 21margin? : optional : is one of the following string 22 - Recommended : Default 23 - Small 24 - Big 25startingPage? : optional : is a integer should be >=1 and <=max pages in pdf 26endingPage? : optional : is a integer should be >=1 and <=max pages in pdf and >= startingPage 27startingNumber? : optional : is a integer denoting the first page number : 1 by default 28textSize? : optional 16 by default is a integer 29*/
1import { imageToPDF } from "pdf-actions"; 2 3const PDFDocumentFromJPG = await imageToPDF( 4 image, 5 pageNumberPosition, 6 margin, 7 startingPage, 8 endingPage, 9 startingNumber, 10 textSize 11); 12/* 13image is a base64 data string 14pageSize? : optional : is one of the following string 15 - Same as Image 16 - 2A0 , 4A0 , A[0-10] , B[0-10] , C[0-9] , Executive , Folio , Legal , Letter , RA[0-4] , SR[0-4] , Tabloid 17pageOrientation? : optional : should pe portrait in case of Same as Image 18imagePosition? : optional : should be Start in case of Same as Image 19degree? : rotate created PDF 20marginMillimeter? : optional paramenter : array of length 4 21 marginMillimeter[0] -> Left 22 marginMillimeter[1] -> Top 23 marginMillimeter[2] -> Right 24 marginMillimeter[3] -> Bottom 25*/
To install the latest stable version:
1npm install --save pdf-actions
1yarn add pdf-actions
This assumes you're using npm or yarn as your package manager.
The repo for the project site (and generated documentation files) is located here: https://github.com/ManasMadan/pdf-actions
No vulnerabilities found.
No security vulnerabilities found.