JNI Interface Documentation
This document details all the JNI interfaces exported by the dynamic library implementation in AxConverterDll.cpp.
All JNI methods are mapped to the Java class com.tailormade.AxDllConvert.
Summary of Interfaces
| # | JNI Method Name | Return Type | Key Parameters | Description |
|---|---|---|---|---|
| 1 | InitDll |
jint |
None | Initializes the DLL and CAD engine. |
| 2 | UninitDll |
jint |
None | Uninitializes the DLL and CAD engine. |
| 3 | Shaker |
jint |
jstring shake |
Validates a security/license key. |
| 4 | SetInputName |
jint |
jstring name |
Sets the input file path (ASCII). |
| 5 | SetInputNameUnicode |
jint |
jstring name |
Sets the input file path (UTF-8/Unicode support). |
| 6 | SetOutputName |
jint |
jstring name |
Sets the output file path (ASCII). |
| 7 | SetOutputNameUnicode |
jint |
jstring name |
Sets the output file path (UTF-8/Unicode support). |
| 8 | SetInputDirectory |
jint |
jstring name |
Sets the input directory path. |
| 9 | SetOutputDirectory |
jint |
jstring name |
Sets the output directory path. |
| 10 | SetBreakByLayer |
jint |
None | Enables separate output generation per layer. |
| 11 | SetBlackAndWhite |
jint |
None | Configures monochrome output conversion. |
| 12 | SetLastSavedView |
jint |
None | Configures layout rendering to use the last saved view. |
| 13 | SetPaperSpace |
jint |
None | Configures target conversion space to Paper Space. |
| 14 | SetModelSpace |
jint |
None | Configures target conversion space to Model Space. |
| 15 | SetLayoutName |
jint |
jstring layoutname |
Sets target layout name to convert. |
| 16 | SetViewName |
jint |
jstring viewname |
Sets target named view to convert. |
| 17 | SetCSVName |
jint |
jstring csvname |
Sets the path/name for extracted CSV data. |
| 18 | SetViewMode |
jint |
jint ViewMode |
Sets the CAD rendering view mode. |
| 19 | SetTraceMode |
jint |
jint TraceMode |
Sets the level/mode of logging/trace execution. |
| 20 | SetVersion |
jint |
jint ver |
Sets target CAD database output version. |
| 21 | SetLineWidthScale |
jint |
jdouble lws |
Scales line widths in output vector files. |
| 22 | SetOutputFormat |
jint |
jint fmt |
Sets target format (PDF, SVG, DWG, DXF, PNG, JPEG, etc.). |
| 23 | SetBackground |
jint |
jint back |
Configures background color code. |
| 24 | SetDrawingHeight |
jint |
jlong hgt |
Sets output drawing/raster height in pixels/units. |
| 25 | SetDrawingWidth |
jint |
jlong wid |
Sets output drawing/raster width in pixels/units. |
| 26 | SetAutoTrim |
jint |
jint trim |
Sets automatic trim options. |
| 27 | SetCSVMode |
jint |
None | Enables CSV data extraction mode. |
| 28 | Convert |
jint |
None | Executes the main conversion pipeline. |
| 29 | SaveAsDxf |
jint |
jint version |
Exports the database directly as DXF. |
| 30 | SaveAsDwg |
jint |
jint version |
Exports the database directly as DWG. |
| 31 | IsBusy |
jint |
None | Returns whether conversion is active (stubbed). |
| 32 | ZoomToExtents |
jint |
None | Instructs the converter to fit drawings to window size. |
| 33 | OpenInputFile |
jint |
None | Opens the pre-configured input file. |
| 34 | OpenInputFile2 |
jint |
jstring name |
Configures and immediately opens an input file. |
| 35 | FileIsOpen |
jboolean |
None | Checks if a drawing database is currently open. |
| 36 | CloseInputFile |
jint |
None | Closes the currently loaded drawing database. |
| 37 | GetNumberOfLayouts |
jint |
None | Gets count of layouts in the active drawing. |
| 38 | GetLayoutName |
jstring |
jint iLayout |
Retrieves layout name at the given index. |
| 39 | GetNumberOfNamedViews |
jint |
None | Gets count of named views in the active drawing. |
| 40 | GetViewName |
jstring |
jint iView |
Retrieves named view at the given index. |
| 41 | GetNumberOfLayers |
jint |
None | Gets count of layers in the active drawing. |
| 42 | GetLayerName |
jstring |
jint iLayer |
Retrieves layer name at the given index. |
| 43 | GetLayerStatus |
jboolean |
jint iLayer |
Gets visibility/on-off status of a layer. |
| 44 | SetLayerStatus |
jint |
jint iLayer, jboolean status |
Sets visibility/on-off status of a layer. |
| 45 | SetLicensePath |
jint |
jstring name |
Configures folder path containing license keys. |
| 46 | SetPreviewMode |
jint |
jboolean mode |
Controls creation of Preview Thumbnail when DWG or DXF file is saved. |
Detailed Interface Documentation
1. InitDll
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_InitDll(JNIEnv *env, jobject obj) - Implementation: Calls
InitDll()internally. This initializes global rendering structures, initializes the Oda CAD core APIs (odInitializewithsvcs), maps static CAD modules, and configures licensing limits/checks. - Return Value:
0(FALSE).
2. UninitDll
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_UninitDll(JNIEnv *env, jobject obj) - Implementation: Calls
cax.UnInitialize()(if format isn’t raw DWG/DXF) and callsCv_CleanUp()to uninitialize the Oda CAD engine (odgsUninitializeandodUninitialize). - Return Value:
0(FALSE).
3. Shaker
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_Shaker(JNIEnv *env, jobject obj, jstring shake) - Implementation: Converts
shaketo a UTF string and callscax.Shaker(shakeit)to validate. Used to unlock licensed operations. - Return Value:
0on success,-668on failure/invalid security key.
4. SetInputName
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetInputName(JNIEnv *env, jobject obj, jstring name) - Implementation: Converts
nameto a UTF-8 string and passes it directly tocax.SetInputName(str). - Return Value: Status code returned by
SetInputName.
5. SetInputNameUnicode
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetInputNameUnicode(JNIEnv *env, jobject obj, jstring name) - Implementation: Converts UTF-8 representation to Unicode using
OdCharMapper::utf8ToUnicode(on Windows platforms) to handle file paths with international/Unicode characters. Callscax.SetInputName(sFilePath). On Linux, passes UTF-8 directly. - Return Value: Status code.
6. SetOutputName
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetOutputName(JNIEnv *env, jobject obj, jstring name) - Implementation: Sets output file name by calling
cax.SetOutputName(str)with ASCII conversion. - Return Value: Status code.
7. SetOutputNameUnicode
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetOutputNameUnicode(JNIEnv *env, jobject obj, jstring name) - Implementation: Similar to
SetInputNameUnicode, handles Unicode conversion for target output file path usingOdCharMapper::utf8ToUnicode. Callscax.SetOutputName(sFilePath). On Linux, falls back to raw UTF-8. - Return Value: Status code.
8. SetInputDirectory
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetInputDirectory(JNIEnv *env, jobject obj, jstring name) - Implementation: Sets directory path to read CAD resources/drawings via
cax.SetInputDirectory(str). - Return Value: Status code.
9. SetOutputDirectory
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetOutputDirectory(JNIEnv *env, jobject obj, jstring name) - Implementation: Sets target output directory via
cax.SetOutputDirectory(str). - Return Value: Status code.
10. SetBreakByLayer
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetBreakByLayer(JNIEnv *env, jobject obj) - Implementation: Sets standard layer breaking flag (
cax.SetBreakByLayer(true)). - Return Value:
0(false).
11. SetBlackAndWhite
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetBlackAndWhite(JNIEnv *env, jobject obj) - Implementation: Forces monochrome conversion by calling
cax.SetBlackAndWhite(). - Return Value: Output of the configuration function.
12. SetLastSavedView
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetLastSavedView(JNIEnv *env, jobject obj) - Implementation: Tells CAD renderer to output the exact last saved layout view state via
cax.SetLastSavedView(). - Return Value: Status code.
13. SetPaperSpace
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetPaperSpace(JNIEnv *env, jobject obj) - Implementation: Forces target rendering output to utilize Paper Space via
cax.SetPaperSpace(). - Return Value: Status code.
14. SetModelSpace
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetModelSpace(JNIEnv *env, jobject obj) - Implementation: Forces target rendering output to utilize Model Space via
cax.SetModelSpace(). - Return Value: Status code.
15. SetLayoutName
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetLayoutName(JNIEnv *env, jobject obj, jstring layoutname) - Implementation: Configures target layout drawing name for extraction using
cax.SetLayoutName(str). - Return Value: Status code.
16. SetViewName
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetViewName(JNIEnv *env, jobject obj, jstring viewname) - Implementation: Configures specific drawing view name for extraction using
cax.SetViewName(str). - Return Value: Status code.
17. SetCSVName
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetCSVName(JNIEnv *env, jobject obj, jstring csvname) - Implementation: Sets output path for tabular meta-data extraction via
cax.SetCSVName(str). - Return Value: Status code.
18. SetViewMode
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetViewMode(JNIEnv *env, jobject obj, jint ViewMode) - Implementation: Passes rendering viewport flags to
cax.SetViewMode(ViewMode). - Return Value: Status code.
19. SetTraceMode
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetTraceMode(JNIEnv *env, jobject obj, jint TraceMode) - Implementation: Configures diagnostic trace levels through
cax.SetTraceMode(TraceMode). - Return Value: Status code.
20. SetVersion
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetVersion(JNIEnv *env, jobject obj, jint ver) - Implementation: Sets output DWG/DXF target version via
cax.SetVersion(ver). - Return Value: Status code.
21. SetLineWidthScale
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetLineWidthScale(JNIEnv *env, jobject obj, jdouble lws) - Implementation: Sets vector line width scaling scale value via
cax.SetLineWidthScale(lws). - Return Value:
0(false).
22. SetOutputFormat
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetOutputFormat(JNIEnv *env, jobject obj, jint fmt) - Implementation: Passes target rendering format code (e.g. PDF, SVG, DXF, DWG) using
cax.SetOutputFormat(fmt). - Return Value: Status code.
23. SetBackground
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetBackground(JNIEnv *env, jobject obj, jint back) - Implementation: Passes background color selection to
cax.SetBackground(back). - Return Value: Status code.
24. SetDrawingHeight
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetDrawingHeight(JNIEnv *env, jobject obj, jlong hgt) - Implementation: Sets layout/pixel height constraints via
cax.SetDrawingHeight(hgt). - Return Value: Status code.
25. SetDrawingWidth
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetDrawingWidth(JNIEnv *env, jobject obj, jlong wid) - Implementation: Sets layout/pixel width constraints via
cax.SetDrawingWidth(wid). - Return Value: Status code.
26. SetAutoTrim
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetAutoTrim(JNIEnv *env, jobject obj, jint trim) - Implementation: Sets configuration options for auto-trimming bounds using
cax.SetAutoTrim(trim). - Return Value: Status code.
27. SetCSVMode
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetCSVMode(JNIEnv *env, jobject obj) - Implementation: Sets CSV extraction modes flag via
cax.SetCSVMode(). - Return Value: Status code.
28. Convert
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_Convert(JNIEnv *env, jobject obj) - Implementation: Invokes the main conversion execution cycle (
cax.Convert()). - Return Value: Status code from converter operation.
29. SaveAsDxf
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SaveAsDxf(JNIEnv *env, jobject obj, jint version) - Implementation: Serializes current CAD model space to DXF utilizing explicit AutoCAD version formatting:
cax.SaveAsDxf((OdDb::DwgVersion)version). - Return Value: Status code.
30. SaveAsDwg
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SaveAsDwg(JNIEnv *env, jobject obj, jint version) - Implementation: Serializes current CAD model space to DWG utilizing explicit AutoCAD version formatting:
cax.SaveAsDwg((OdDb::DwgVersion)version). - Return Value: Status code.
31. IsBusy
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_IsBusy(JNIEnv *env, jobject obj) - Implementation: Simple boolean stub.
- Return Value: Always returns
false(0).
32. ZoomToExtents
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_ZoomToExtents(JNIEnv *env, jobject obj) - Implementation: Signals engine to calculate bounding coordinates and zoom/scale output structure accordingly via
cax.ZoomToExtents(). - Return Value:
0(false).
33. OpenInputFile
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_OpenInputFile(JNIEnv *env, jobject obj) - Implementation: Attempts to open input file matching the name obtained by
cax.GetInputFile(). Wraps in a genericcatch (...)and returns-666upon error. - Return Value: Conversion engine open result on success,
-666on exception.
34. OpenInputFile2
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_OpenInputFile2(JNIEnv *env, jobject obj, jstring name) - Implementation: Sets the input filename using JNI UTF extraction, releases it, and runs
cax.OpenInputFile(str)inside a generic exception handler. - Return Value: Open result, or
-666if an exception occurs.
35. FileIsOpen
- Signature:
JNIEXPORT jboolean JNICALL Java_com_tailormade_AxDllConvert_FileIsOpen(JNIEnv *env, jobject obj) - Implementation: Checks if database is loaded (
cax.FileIsOpen()). - Return Value:
jbooleanstatus of open file.
36. CloseInputFile
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_CloseInputFile(JNIEnv *env, jobject obj) - Implementation: Calls
cax.CloseInputFile()to unload active structures. - Return Value: Engine close operation status.
37. GetNumberOfLayouts
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_GetNumberOfLayouts(JNIEnv *env, jobject obj) - Implementation: Retrieves
layoutCountparsed from database information insidecax.GetNumberOfLayouts(). - Return Value: Number of layouts found in file.
38. GetLayoutName
- Signature:
JNIEXPORT jstring JNICALL Java_com_tailormade_AxDllConvert_GetLayoutName(JNIEnv *env, jobject obj, jint iLayout) - Implementation: Calls
cax.GetLayoutName(iLayout, str)to fetch layout name into a character array buffer, and returns it asNewStringUTF. - Return Value:
jstringcontaining the layout name at specified index.
39. GetNumberOfNamedViews
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_GetNumberOfNamedViews(JNIEnv *env, jobject obj) - Implementation: Retrieves
viewCountparsed from database information insidecax.GetNumberOfNamedViews(). - Return Value: Number of named views.
40. GetViewName
- Signature:
JNIEXPORT jstring JNICALL Java_com_tailormade_AxDllConvert_GetViewName(JNIEnv *env, jobject obj, jint iView) - Implementation: Calls
cax.GetNamedView(iView, str)to copy view name at given index, and returns as JNI string object. - Return Value:
jstringview name.
41. GetNumberOfLayers
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_GetNumberOfLayers(JNIEnv *env, jobject obj) - Implementation: Returns layers count from parsed CAD database using
cax.GetNumberOfLayers(). - Return Value: Total count of drawing layers.
42. GetLayerName
- Signature:
JNIEXPORT jstring JNICALL Java_com_tailormade_AxDllConvert_GetLayerName(JNIEnv *env, jobject obj, jint iLayer) - Implementation: Calls
cax.GetLayerName(iLayer, str)to copy layer name at given index, returning JNI UTF string object. - Return Value:
jstringcontaining the layer name.
43. GetLayerStatus
- Signature:
JNIEXPORT jboolean JNICALL Java_com_tailormade_AxDllConvert_GetLayerStatus(JNIEnv *env, jobject obj, jint iLayer) - Implementation: Calls
cax.GetLayerStatus(iLayer)which pulls status fromlayerStatusArray. - Return Value:
jbooleanvisible/on status.
44. SetLayerStatus
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetLayerStatus(JNIEnv *env, jobject obj, jint iLayer, jboolean status) - Implementation: Calls
cax.SetLayerStatus(iLayer, status)which updateslayerStatusArrayand sets thebLayerStatusUpdateddirty flag totrue. - Return Value: Status code.
45. SetLicensePath
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetLicensePath(JNIEnv *env, jobject obj, jstring name) - Implementation: Configures
LicensePathglobal variable using standard UTF conversion ofnamestring. - Return Value:
false(0).
46. SetPreviewMode
- Signature:
JNIEXPORT jint JNICALL Java_com_tailormade_AxDllConvert_SetPreviewMode(JNIEnv *env, jobject obj, jboolean mode) - Implementation: Controls whether a Preview Thumbnail is created when an AutoCAD DXF or DWG file is created.
- Return Value:
false(0).