Skip to content

Commit

Permalink
Fix : Corrected content type for PDFs
Browse files Browse the repository at this point in the history
  • Loading branch information
MurageKabui authored Aug 8, 2021
1 parent 74083fc commit 8d1df1e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions OCRSpaceUDF/_OCRSpace_UDF.au3
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; Title ...............: _OCRSpace_UDF.au3
; Author ..............: Kabue Murage
; AutoIt Version ......: 3.3.14.5
; UDF Version .........: v1.0
; UDF Version .........: v1.3
; OCRSpace API Version : V3.50
; Language ............: English
; Description .........: Convert image to text using the OCRSpace API version 3.50
Expand Down Expand Up @@ -426,7 +426,6 @@ Func _OCRSpace_ImageGetText($aOCR_OptionsHandle, $sImage_UrlOrFQPN, $iReturnType

; extended utf-8 charset incase the json contains accents i.e characters like àèéìòù
$s_lAPIResponseText__ = _WinAPI_WideCharToMultiByte($s_lAPIResponseText__, 65001)

Switch Int($i_lAPIRespStatusCode__)
Case 200
; If ($aOCR_OptionsHandle[3][1]) And ($iReturnType = 1) Then
Expand Down Expand Up @@ -455,15 +454,15 @@ Func _OCRSpace_ImageGetText($aOCR_OptionsHandle, $sImage_UrlOrFQPN, $iReturnType
Case 0, Default, -1
Return SetError($__ErrorCode_, $s_lProcessingTimeInMs, $s_lDetectedTxt__)
Case 1
; If Not ($aOCR_OptionsHandle[3][1]) Then
; ConsoleWrite("Overlay info was NOT requested at _OCRSpace_SetUpOCR()" & @CRLF)
; ; return a stractured array nevertheless
; Local $aRet[1][2]

; $aRet[0][0] = Stringlen($aRet)
; $aRet[0][1] = $s_lDetectedTxt__
; Return SetError(($__ErrorCode_ = 111 ? 0 : $__ErrorCode_), $s_lProcessingTimeInMs, $aRet)
; EndIf
If Not ($aOCR_OptionsHandle[3][1]) Then
ConsoleWrite("Overlay info was NOT requested at _OCRSpace_SetUpOCR()" & @CRLF)
; return a stractured array nevertheless
Local $aRet[1][2]

$aRet[0][0] = Stringlen($aRet)
$aRet[0][1] = $s_lDetectedTxt__
Return SetError(($__ErrorCode_ = 111 ? 0 : $__ErrorCode_), $s_lProcessingTimeInMs, $aRet)
EndIf

Local $a_lOverlayArray__[0][5]
Local $i_lEnumAllJSONObj__ = 0, $i_lEnumLinesJSONObj__ = 0, $i_lEnum_row__ = 0
Expand Down

0 comments on commit 8d1df1e

Please sign in to comment.