HANDLE .CHNP-SESSION-JSON
file using API script
const chnpObject = new chnpFile(fileJson);
type:void
There is array of print pages in chnp file which lets you access final printing pages
{
"printList": [
{
"title": "",
"code": "",
"output": "",
"filename": "",
"rtf": "\n Paste Your Image Here",
"watermark": "github:sgi-capp-at2/code-highlight-n-print",
"rtfBool": "false"
},
]
}
You can use it as you use for in/of
loop
CHNPFILEOBJECT.forInPrintList((i,item)=>{
/*
@param i access index
@param item access JSON of page contents which are given above in #ARRAY-PREV
*/
console.log(i,item); // READ
item.title="MY NEW TITLE"; // WRITE
return item; // neccessary to keep return statement
// don't keep return item if you want to delete the item
});
type:void
There is time saved in chnp file that shows when the file created
{
"time":1669259632885
}
It lets you override the time saved in the chnp file with current time
CHNPFILEOBJECT.setCurrentTime(); // no parameters
ShGI