Skip to main content

PDF-Card-OCR

Command Description

The page number specified by the PDF via Laiye Intelligent Document Processing CARD OCR, NUMBER OF RESULTS RETURNED group If one page fails if one page fails, and the quota is consumed

Command Prototype

arrayRet = Mage.PDFOCRCard(config, path,password,all_pg_state,page_cfg,sleepTime,time)

Parameter Description

ParameterRequiredTypeDefaultDescription
configTrueexpression{}Call configuration of Laiye IDP
pathTruepath'''C:\Users'''Path of the PDF file
passwordTruestring""PDF file password. No need to fill in if no password
all_pg_stateTruebooleanNoneWhen all the page numbers are set to "Yes", they can identify all and specified page number input invalid settings, can specify the page number identification
page_cfgTrueexpression[[1,2]]Positive integer and array format are supported, for example, if users input 2, then the second page would be identified. If users input [1,3,5], the first, third, and fifth pages would be identified. If users input [1,[6,9],4], the first, fourth, sixth and nineth pages would be identified. When the "Recognize all pages" is set to "Yes", the value input to specify pages would be invalid. An error will be reported if the number of pages exceeds the total number of PDF pages, and each page will be identify only once
sleepTimeTruenumber10000The interval (in milliseconds) of each page in the PDF file is by default 10,000 milliseconds (10 seconds). The larger number of pages to be recognized and the short interval may lead to the exception of exceeded call frequencies
timeTruenumber30000Specify the waiting time in milliseconds. If exceeded, an exception will be thrown. Default: 30,000 milliseconds (30 seconds)

return

arrayRet,The variable used to save the output of the command.

Demo

Dim config={"Pubkey":"","Secret":"","Url":""}  // Get from mage 
Dim path='''''' // The path of the PDF file containing the image card to be recognized

TracePrint "--------------------PDF Card Identification--------------------"
// --------------------------------------------------------
// [Remarks] PDF card identification
// Input parameter 1:
// config--mage configuration, need to configure Pubkey and Secret.Type:Dict
// Input parameter 2:
// path--The path of the PDF file containing the image card to be recognized
// Input parameter 3:
// password--password
// Input parameter 4:
// all_pg_state--whether all pages are recognized
// Input parameter 5:
// page_cfg--Identify the specified page number
// Input parameter 6:
// sleepTime--interval time. Default unit: milliseconds. Type: Int
// Input reference 7:
// time--timeout time. Default unit: milliseconds. Type: Int

// Output parameters:
// arrayRet--The variable to which the output of the function call is saved

// 命令原型:arrayRet = Mage.PDFOCRCard(config, path,password,all_pg_state,page_cfg,sleepTime,time)
// --------------------------------------------------------

arrayRet = Mage.PDFOCRCard(config, path,"",false,[1],10000,30000)