0

When I execute the following code in Visual Studio using Python tools and ironpython 2.7 and PyPDF2 v1.20.

i got this error "int() got an unexpected keyword argument 'base' " line 803 in pdf.py

This is my complete code:

import clr 
clr.AddReference('System.Drawing') 
clr.AddReference('System.Windows.Forms')

from System.Drawing import * 
from System.Windows.Forms import * 
from PyPDF2 import PdfFileReader

class MyForm(Form):

    def __init__(self):
        # Create child controls and initialize form
        self.Text = "Test Project"
        self.Size = Size(600, 500)

        path = "F:/Download/RealPython.pdf"
        f = open(path)
        inputpdf = PdfFileReader(open(path, "rb"))
        page = inputpdf.getPage(8)
        pagecontent = page.extractText()

        display.mediaBox.upperRight = (
            display.mediaBox.getUpperRight_x() / 2,
            display.mediaBox.getUpperRight_y() / 2
        )

Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)

form = MyForm() Application.Run(form)

i got this error "int() got an unexpected keyword argument 'base' " line 803 in pdf.py

Any ideas?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
eureka
  • 67
  • 9
  • try latest [beta](https://ironpython.codeplex.com/releases/view/115611), the bug is fixed there. You should also make sure that your pdf document has at least 9 pages. – Pawel Jasinski Mar 20 '14 at 07:14
  • found solution it was pages it base= in generic.py which has to be removed. – eureka Mar 21 '14 at 10:20

0 Answers0