Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save a740122/00f5e0732ba583be98cca95d00d88731 to your computer and use it in GitHub Desktop.
Save a740122/00f5e0732ba583be98cca95d00d88731 to your computer and use it in GitHub Desktop.
Kivy : create image from pdf page
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