-
-
Save a740122/00f5e0732ba583be98cca95d00d88731 to your computer and use it in GitHub Desktop.
Kivy : create image from pdf page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PythonMagick | |
from pyPdf import PdfFileWriter,PdfFileReader | |
input1 = PdfFileReader(file('/home/steph/menu.pdf', 'rb')) | |
p2=input1.getPage(1) | |
writer=PdfFileWriter() | |
writer.addPage(p2) | |
import io | |
f=io.BytesIO() | |
writer.write(f) | |
blob=pm.Blob(f.read()) | |
img=pm.Image(blob) | |
img.display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment