Coder Social home page Coder Social logo

pdf-merge's Introduction

ahao-pdf-merge合并多个pdf文件实现打印功能

    <pdf-view url='https://pdf-lib.js.org/assets/with_update_sections.pdf,https://pdf-lib.js.org/assets/with_update_sections.pdf,https://pdf-lib.js.org/assets/with_update_sections.pdf,https://pdf-lib.js.org/assets/dod_character.pdf'></pdf-view>
        <button onclick="handlerDownload()">下载pdf1</button>
        <script>
            const pdfView = document.querySelector("pdf-view");
            const video = document.querySelector("video");
            function handlerDownload() {
                pdfView.downLoad()
            }
        </script>
vue写法
    <template>
        <pdf-view :url="urlList" ref="myRef"></pdf-view>
    </template>
export default defineComponent({
  setup() {
    const myRef = ref(null)
    const urlList = ref('')
    //模拟异步请求
    setTimeout(() => {
      urlList.value = 'https://pdf-lib.js.org/assets/with_update_sections.pdf,https://pdf-lib.js.org/assets/with_update_sections.pdf'
    }, 2000);
    const handleDonw = () => {
      myRef.value.controller.download()
    }
    return {
      urlList,
      handleDonw,
      myRef
    }
  },
})
</script>

代码灵感来源:https://github.com/yangxuy/pdf-reader

pdf-merge's People

Contributors

wanghao0730 avatar

Watchers

 avatar

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.