{"action":"closed","issue":{"url":"https://api.github.com/repos/chezou/tabula-py/issues/103","repository_url":"https://api.github.com/repos/chezou/tabula-py","labels_url":"https://api.github.com/repos/chezou/tabula-py/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/chezou/tabula-py/issues/103/comments","events_url":"https://api.github.com/repos/chezou/tabula-py/issues/103/events","html_url":"https://github.com/chezou/tabula-py/issues/103","id":356650416,"node_id":"MDU6SXNzdWUzNTY2NTA0MTY=","number":103,"title":"Multiple issues while i read the PDF","user":{"login":"isaaccwb","id":42923555,"node_id":"MDQ6VXNlcjQyOTIzNTU1","avatar_url":"https://avatars1.githubusercontent.com/u/42923555?v=4","gravatar_id":"","url":"https://api.github.com/users/isaaccwb","html_url":"https://github.com/isaaccwb","followers_url":"https://api.github.com/users/isaaccwb/followers","following_url":"https://api.github.com/users/isaaccwb/following{/other_user}","gists_url":"https://api.github.com/users/isaaccwb/gists{/gist_id}","starred_url":"https://api.github.com/users/isaaccwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isaaccwb/subscriptions","organizations_url":"https://api.github.com/users/isaaccwb/orgs","repos_url":"https://api.github.com/users/isaaccwb/repos","events_url":"https://api.github.com/users/isaaccwb/events{/privacy}","received_events_url":"https://api.github.com/users/isaaccwb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-04T04:39:09Z","updated_at":"2018-09-04T07:44:44Z","closed_at":"2018-09-04T07:44:44Z","author_association":"NONE","body":"# Summary of your issue\r\nHello, I tried to read a pdf via tabula-py however i was experiencing multiple issues.\r\n\r\n# Environment\r\n\r\n- [ ] Paste the output of `python --version` command on your terminal: ?\r\nEnthought Canopy Python 2.7.13 | 64-bit |\r\n\r\n- [ ] Paste the output of `java -version` command on your terminal: ?\r\njava version \"1.8.0_181\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_181-b13)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)\r\n\r\n- [ ] Does `java -h` command work well?; Ensure your java command is included in `PATH`\r\n\r\nshowed below when i ran java -h\r\n\r\n??: java [-options] class [args...]\r\n           (????)\r\n   ?  java [-options] -jar jarfile [args...]\r\n           (?? jar ??)\r\n????:\r\n    -d32          ?? 32 ?????? (?????)\r\n    -d64          ?? 64 ?????? (?????)\r\n    -server       ?? \"server\" VM\r\n                  ??? VM ? server.\r\n\r\n    -cp <??? zip/jar ?????????>\r\n    -classpath <??? zip/jar ?????????>\r\n                  ?? ; ??????JAR ???? ZIP ????????????\r\n    -D<name>=<value>\r\n                  ??????\r\n    -verbose:[class|gc|jni]\r\n                  ????????\r\n    -version      ?????????\r\n    -version:<value>\r\n                  ??: ????????????????????\r\n                  ???????????\r\n    -showversion  ?????????\r\n    -jre-restrict-search | -no-jre-restrict-search\r\n                  ??: ????????????????????\r\n                  ????????/??????? JRE\r\n    -? -help      ???????\r\n    -X            ??????????\r\n    -ea[:<packagename>...|:<classname>]\r\n    -enableassertions[:<packagename>...|:<classname>]\r\n                  ????????????\r\n    -da[:<packagename>...|:<classname>]\r\n    -disableassertions[:<packagename>...|:<classname>]\r\n                  ????????????\r\n    -esa | -enablesystemassertions\r\n                  ??????\r\n    -dsa | -disablesystemassertions\r\n                  ??????\r\n    -agentlib:<libname>[=<options>]\r\n                  ??????????? <libname>??? -agentlib:hprof\r\n                  ???? -agentlib:jdwp=help ? -agentlib:hprof=help\r\n    -agentpath:<pathname>[=<options>]\r\n                  ???????????????????\r\n    -javaagent:<jarpath>[=<options>]\r\n                  ?? Java ???????????? java.lang.instrument\r\n    -splash:<imagepath>\r\n                  ?????????????\r\n??? http://www.oracle.com/technetwork/java/javase/documentation/index.html ???????\r\n\r\n- [ ] Write your OS and it's version: ? \r\nWIndows 10 X64\r\n\r\nProviding PDF would be really helpful to resolve the issue.\r\nhttp://www.hkexnews.hk/listedco/listconews/SEHK/2018/0815/LTN20180815893_C.PDF\r\n\r\n\r\nProvide your information to reproduce the issue.\r\n## Code:\r\nOriginal code:\r\n\r\nimport tabula\r\nimport pandas as pd\r\nimport requests\r\nimport distro\r\n\r\nfilename=\"C:\\Users\\isaac\\Downloads\\LTN20180815893_C.PDF\" #I saved the PDF in my downloads folder\r\npageno=1\r\n\r\ndf=read_pdf(filename, pages=pageno, pandas_options={'header':None} )\r\ndf.fillna(\"\")\r\n\r\nResult:\r\nNameError: name 'read_pdf' is not defined \r\n\r\nResolution:\r\nI added from tabula import read_pdf to the code\r\n\r\nimport tabula\r\nimport pandas as pd\r\nimport requests\r\nimport distro\r\n\r\nfrom tabula import read_pdf\r\nfilename=\"C:\\Users\\isaac\\Downloads\\LTN20180815893_C.PDF\"\r\npageno=1\r\ndf=read_pdf(filename, pages=pageno, pandas_options={'header':None} )\r\ndf.fillna(\"\")\r\n\r\nAfter this, I run again and have the below error result:\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 0: invalid start byte\r\n\r\nResolution: type chcp 65001 in CMD\r\nand add below code\r\n java_options=\"-Dfile.encoding=UTF8\" like this\r\n\r\nimport tabula\r\nimport pandas as pd\r\nimport requests\r\nimport distro\r\n\r\nfrom tabula import read_pdf\r\n\r\nfilename=\"C:\\Users\\isaac\\Downloads\\LTN20180815893_C.PDF\"\r\npageno=1\r\n\r\n\r\ndf=read_pdf(filename,java_options=\"-Dfile.encoding=UTF8\", pages=pageno, pandas_options={'header':None} )\r\ndf.fillna(\"\")\r\n\r\nAfter I ran this, I have another issue result on below:\r\n%run \"c:\\users\\isaac\\appdata\\local\\temp\\tmp5te0fa.py\"\r\n9æ 04, 2018 12:37:24 ä¸å org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB suggestKCMS\r\nè³è¨: To get higher rendering speed on JDK8 or later,\r\n9æ 04, 2018 12:37:24 ä¸å org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB suggestKCMS\r\nè³è¨:   use the option -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider\r\n9æ 04, 2018 12:37:24 ä¸å org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB suggestKCMS\r\nè³è¨:   or call System.setProperty(\"sun.java2d.cmm\", \"sun.java2d.cmm.kcms.KcmsServiceProvider\")\r\n\r\nExpectation:\r\nI expect to see a result like below page (PDF page1)\r\nhttps://hk.thenewslens.com/article/102379#&gid=1&pid=1\r\n\r\nPlease help!\r\nThanks\r\n\r\n"}}
{"actor":{"display_login":"chezou"}}