diff --git a/package.json b/package.json index badd75f..7ffbc81 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "keywords": [ "pdf", "forms", "poppler", "qt4", "cairo" ], - "version": "0.1.2", + "version": "0.1.3", "repository": { "type": "git", "url": "git://github.com/tpisto/pdf-fill-form.git" diff --git a/src/NodePoppler.cc b/src/NodePoppler.cc index 5531a4a..41ae68e 100644 --- a/src/NodePoppler.cc +++ b/src/NodePoppler.cc @@ -27,7 +27,12 @@ using v8::Array; using v8::Value; inline bool fileExists (const std::string& name) { - return ( access( name.c_str(), F_OK ) != -1 ); + if (FILE *file = fopen(name.c_str(), "r")) { + fclose(file); + return true; + } else { + return false; + } } // Cairo write and read functions (to QBuffer)