parse

parses the contents of uploaded file or base64 string into the viewer

void parse(promise|string|array|object data, [string type,boolean clear] );
data
promise|string|array|objectthe data to add type
stringthe data type: 'json' (default), 'xml', 'csv', 'jsarray', "excel" (combined with "binary" proxy) clear
booleanif true, the current data are erased before new data are parsed

Example

// Base64 string
 
var base64data = ..decoded base64 data..;
$$("pdf").parse({data:base64data});
 
// Uploaded file
{   
    view:"uploader", 
    width:200, 
    height:45, 
    value:"Choose a PDF file to upload", 
    accept:"application/pdf", on:{
        onBeforeFileAdd:function(upload){
            $$("pdf").parse(upload.file);
        return false;
    }
}}

Related samples

Details

The data parameter can have the following types:

If you want to parse data in addition to the existing dataset, specify position of parsing, namely the index from which you insert new data:

$$("datatable").parse({
    // the number of records will be equal to the last index plus 1
    pos: $$("datatable").count(),
    data:dataset
});
See also
  • API
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
    If you have not checked yet, be sure to visit site of our main product Webix js frameworks and page of pdf js viewer product.