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

How to remove pages in a doc before rendered in the View ? #6

Open
ghost opened this issue Nov 7, 2020 · 3 comments
Open

How to remove pages in a doc before rendered in the View ? #6

ghost opened this issue Nov 7, 2020 · 3 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Nov 7, 2020

Hi !

I would like to load a pdf and remove, say the first page, BEFORE it is rendered.
I've tried to load the pdf normally, then remove a page, but it's very slow as all
has to be redrawn again.

Do I really have to use an external pdf parser ?

Thank you very much !

@wbsoft
Copy link
Contributor

wbsoft commented Dec 25, 2020

Yes, one way to do it is:

import qpageview
doc = qpageview.loadPdf("bla.pdf")
del doc.pages()[0]
v = qpageview.View()
v.show()
v.setDocument(doc)

@wbsoft
Copy link
Contributor

wbsoft commented Dec 25, 2020

Today I also added the View.setPages() method, to more easily load a list of Page objects.

@ghost
Copy link
Author

ghost commented Jan 3, 2021

Thank you !

@wbsoft wbsoft added the question Further information is requested label Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant