captureDocument()

Description

Captures a document.

Syntax

func captureDocument()

Parameters

None

Return value

Void

Remarks

If the function is executed asynchronously, it will first trigger the event onPreCapture, then the capture operation, and finally, trigger the event onPostCapture. Before the event onPostCapture is triggered, the captured document will be added to the current DcsView buffer.

Make sure the current camera is open before calling this method. You can open the camera via preview method.

Exceptions

Circumstance Exception thrown
License verfication failed. DcsLicenseVerificationFailedException
The capture mode is not DME_DOCUMENT. DcsOnlySupportedUnderDocumentModeException
The access to the camera is not authorized. DcsCameraNotAuthorizedException
The current camera is not open. DcsOperationSequenceExeption

Example

class ViewController: UIViewController{
var dcsView=DcsView()
override func viewDidLoad() {
        super.viewDidLoad()
        dcsView = DcsView(frame: CGRect(x:0,y:0,width:self.view.frame.size.width,height:self.view.frame.size.height))
        dcsView.currentView=DVE_VIDEOVIEW
        dcsView.videoView.mode=DME_DOCUMENT
        view.addSubview(dcsView)
        dcsView.videoView.captureDocument()
    }
}
Is this page helpful?

Leave a Reply

Your email address will not be published.