GithubHelp home page GithubHelp logo

manasmadan / pdf-actions Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 6.0 42 KB

A NPM Package built on top of pdf-lib that provides functonalities like merge, rotate, split,download pdf to disk and many more...

Home Page: https://pdfactions.vercel.app/

License: MIT License

JavaScript 100.00%
javascript npm pdf pdf-download pdf-downloader pdf-free pdf-lib pdf-merge pdf-merger pdf-online pdf-processing pdf-rotate pdf-split pdf-splitter react react-component reactjs

pdf-actions's Introduction

Hi ๐Ÿ‘‹, I'm Manas Madan

Follow on LinkedIn

A passionate Fullstack Developer from India

  • ๐ŸŒฑ Iโ€™m currently learning Qwik, C++ ,DSA

  • ๐Ÿ‘จโ€๐Ÿ’ป All of my projects are available Here

  • ๐Ÿ’ฌ Ask me about React, Next JS, MERN Stack and other WebD Tech

  • ๐Ÿ“ซ Reach me at [email protected]

  • ๐Ÿ“„ Know about my experiences Here

  • โšก Fun fact I love Leading Projects ๐Ÿ’–

Connect with me:

manasmadan08 manas-madan-5ab997244 17327182 manas_madan08 manasmadan manasmadan

Languages and Tools:

appwrite arduino bootstrap c chartjs cplusplus css3 electron express figma firebase git heroku html5 javascript materialize mongodb mssql mysql nextjs nodejs postgresql postman python react redux sass svelte tailwind typescript

manasmadan

ย manasmadan

manasmadan

pdf-actions's People

Contributors

juanrivlaz avatar manasmadan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pdf-actions's Issues

mergePDF.js: Uncaught (in promise) TypeError: fileDoc.getPageIndices is not a function

Error in mergePDF function, steps to reproduce:

I have an array of Unit8Array elements, where each Unit8Array represents an encoded PDF, then I do:

const files = encodedPdfUnit8Array.map(pdf => {
                    const blob = new Blob([pdf, {type: 'application/pdf'});
                    return new File([blob], "", {lastModified: new Date().getTime(), type: blob.type});
                });

// and then I do
const mergePDFHandler = async (files) => {
         // note the missing async after the forEach loop which is not in the docs.
        files.forEach(async (file)=>await createPDF.PDFDocumentFromFile(file))
        const mergedPDFDocument = await mergePDF(files)
        const mergedPdfFile = await mergedPDFDocument.save();
        const pdfBlob = pdfArrayToBlob(mergedPdfFile);
      };

output is:

mergePDF.js:10 Uncaught (in promise) TypeError: fileDoc.getPageIndices is not a function
    at mergePDF (<anonymous>:37507:62)

Am I doing anything wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.