Created
November 11, 2012 00:23
-
-
Save ryancole/4053133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <node.h> | |
#include <v8.h> | |
#ifndef UNIX | |
#define UNIX | |
#define UNIX_64 | |
#endif | |
#include <scctype.h> | |
#include <sccex.h> | |
using namespace v8; | |
Handle<Value> convert (const Arguments& args) { | |
HandleScope scope; | |
return scope.Close(Undefined()); | |
} | |
void initialize (Handle<Object> target) { | |
VTDWORD loadSettings = OI_INIT_DEFAULT | OI_INIT_NOSAVEOPTIONS | OI_INIT_NOLOADOPTIONS; | |
// initialize data access module | |
if (DAInitEx(DATHREAD_INIT_NOTHREADS, loadSettings) != DAERR_OK) | |
ThrowException(Exception::TypeError(String::New("failed to initialize pdf export engine"))); | |
// export convert function | |
target->Set(String::NewSymbol("convert"), FunctionTemplate::New(convert)->GetFunction()); | |
} | |
NODE_MODULE(topdf, initialize) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment