insertDocument()

Description

Inserts a document into DcsBuffer at the index.

Syntax

- (void) insertDocument: (DcsDocument *) document
index: (NSInteger) index

Parameters

document:DcsDocument The image data to be inserted.
index:NSInteger The index to insert the document.

Return value

Void

Remarks

If the index equals 0, the document object will be added at the beginning of DcsBuffer.
If the index equals count, the document object will be added at the end of DcsBuffer.

Exceptions

Circumstance Exception thrown
index < 0 or index > count DcsValueOutOfRangeException
Document is not DcsImage. DcsTypeNotValidException
Document is nil. DcsValueNotValidException

Example


@interface ViewController () {
    DcsView *dcsView;
}
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
     
    dcsView = [[DcsView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
 
    [self.view addSubview:dcsView];

    UIImage *Rimg = [UIImage imageNamed:@"twain"];
    DcsDocument *DcsRDoc = [[DcsDocument alloc]init:Rimg];
    [self.dcsView.buffer insertDocument: DcsRDoc index:1];
}

@end