Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import img2pdf
  2. a4inpt = (img2pdf.mm_to_pt(210),img2pdf.mm_to_pt(297))
  3. layout_fun = img2pdf.get_layout_fun(a4inpt)
  4.  
  5. #path to the output pdf
  6. output_pdf = "pdfimg.pdf"
  7.  
  8. #path to input image
  9. input_img = "C:\\Users\\Muktadir Khan\\Documents\\Scanned Documents\\B.Tech. Year 1 First Attempt.jpg"
  10.  
  11. with open(output_pdf,"wb") as f:
  12. f.write(img2pdf.convert(input_img.encode(),layout_fun=layout_fun))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement