Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render multiple pages/whole document #11

Closed
hendrikschneider opened this issue Aug 2, 2017 · 4 comments
Closed

Render multiple pages/whole document #11

hendrikschneider opened this issue Aug 2, 2017 · 4 comments

Comments

@hendrikschneider
Copy link

Hi,

is it possible to render multiple pages at once?

@andreasvirkus
Copy link
Contributor

Ping, any ETA on this?

@andreasvirkus
Copy link
Contributor

andreasvirkus commented Jan 4, 2018

I currently used an ugly workaround, but it feels like a lot of
overhead to render N instances of vue-pdf:

<template>
  <section>
    <spinner v-if="loading">
    <template v-else>
      <!-- Need to load a single page to get page count -->
      <pdf style="display: none;" :src="contract"
        @num-pages="pageCount = new Array($event)" />
      <!-- Actual document -->
      <pdf v-for="(page, index) in pageCount"
        :key="index"
        :src="contract"
        :page="index + 1"
        class="contract-container" />
    </template>
  </section>
</template>

<script>
  import pdf from 'vue-pdf';

  export defualt {
    components: { pdf },
    data() {
      return {
        loading: true,
        pageCount: [],
        contract: { data: '' }
      }
    }
  }
</script>  

@FranckFreiburger
Copy link
Owner

see https://github.com/FranckFreiburger/vue-pdf#example---display-multiple-pages-of-the-same-pdf-document

@jerrychong25
Copy link

If u wanna with scroll whole PDF document with full size pages, using @FranckFreiburger (https://github.com/FranckFreiburger/vue-pdf#example---display-multiple-pages-of-the-same-pdf-document) example, plus just change styling to height with 100%, as per following:

<pdf
     v-for="i in numPages"
     :key="i"
     :src="src"
     :page="i"
     style="height: 100%"
></pdf>

Then it will be working as per expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants