Skip to content

Instantly share code, notes, and snippets.

@rmtheis
Created August 11, 2015 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmtheis/19965abdfca5c2c9eb26 to your computer and use it in GitHub Desktop.
Save rmtheis/19965abdfca5c2c9eb26 to your computer and use it in GitHub Desktop.
JNI code for setting PDF title
jboolean Java_com_googlecode_tesseract_android_TessBaseAPI_nativeBeginDocument(JNIEnv *env,
jobject thiz, jstring title, jlong jRenderer) {
const char *c_title = env->GetStringUTFChars(title, NULL);
tesseract::TessPDFRenderer* pdfRenderer = (tesseract::TessPDFRenderer*) jRenderer;
jboolean res = JNI_TRUE;
if (pdfRenderer->BeginDocument(c_title)) {
res = JNI_FALSE;
}
//env->ReleaseStringUTFChars(title, c_title);
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment