Image To CSV
With the Image to CSV tool, you can convert your Image file into a CSV file. The following examples show how to upload a test Image file and convert it into a CSV file using Java languages.
java
// Create a client
CPDFClient client = new CPDFClient(publicKey,secretKey);
// Create a task
// Create an example of a Image to CSV task
CPDFCreateTaskResult result = client.createTask(CPDFConversionEnum.IMAGE_TO_CSV);
// Get a task id
String taskId = result.getTaskId();
// File handling parameter settings
CIMGToCsvParameter fileParameter = new CIMGToCsvParameter();
fileParameter.setIsAllowOcr(CIMGToCsvParameter.IS_ALLOW_OCR);
// Upload files
client.uploadFile(new File("test.jpg"), taskId, fileParameter);
// Execute task
client.executeTask(taskId);
// Query TaskInfo
CPDFTaskInfoResult taskInfo = client.getTaskInfo(taskId);
Needed Parameters
isCsvMerge
: Whether to merge CSV (1: yes, 0: no) Default 0.
isAllowOcr
: Whether to allow to open OCR (1: yes, 0: no) Default 0.
isOnlyAiTable
:Whether to enable AI to recognize table (1: yes, 0: no) Default 0.
Result:
File Type | Description |
---|---|
.zip | Parameter(isCsvMerge)=0;The CSV file zip after the transfer process is completed. |
.csv | Parameter(isCsvMerge)=1;The CSV file after the transfer process is completed. |