AsposeGetXpsPageCount

AsposeGetXpsPageCount function

Get the number of pages in the xps-document.

function AsposeGetXpsPageCount(
    fileBlob,
    fileName
)
ParameterTypeDescription
fileBlobBlob objectContent of source file.
fileNamestringSource file name.

Return Value

JSON object

FieldDescription
errorCodecode error (0 no error)
errorTexttext error ("" no error)
pageCountnumber of pages

Examples

const AsposePage = require('asposepagenodejs');

const xps_file = "./data/example.xps";

console.log("Aspose.Page for Node.js via C++ examples.");

AsposePage().then(AsposePageModule => {

    let json = AsposePageModule.AsposePageAbout();
    console.log("AsposePageAbout => %O",  json.errorCode == 0 ? JSON.parse(JSON.stringify(json).replace('"errorCode":0,"errorText":"",','')) : "error:" + json.errorText);

    //AsposeGetXpsPageCount
    json = AsposePageModule.AsposeGetXpsPageCount(xps_file);
    console.log("AsposeGetXpsPageCount => %O",  json.errorCode == 0 ? JSON.parse(JSON.stringify(json).replace('"errorCode":0,"errorText":"",','')) : json.errorText);

},
    reason => {console.log(`The unknown error has occurred: ${reason}`);}
);