compileNovelPages(chapterlist){

        try{

            pretty.logPrint("Compiling novel contents...");
            // Iterate through the list of chapters where c is the chapters
            // and the p is your paragraph, this has a time complexity of O(c*p)
            for(var c = 0; c<chapterlist.length; c++){

                let { chapter, content } = chapterlist[c];
                let { title } = content;

                this.doc.addPage()
                    .fontSize(25)
                    .text(`${title} (${chapter})`, 100, 100)
                    .moveDown()

                for(var p=0; p<content["content"].length; p++){

                    this.doc.fontSize(12)
                        .text(content["content"][p])
                        .moveDown();

                }
            }

            this.doc.end();

            pretty.logWrite("Compiling of novel is done! Check the output on: ");
            pretty.cPrint(`${this.dir}`,"b");
            pretty.lineBreak();
        }
        catch(err){
            console.log(chapterlist)
            errDict.customError(err);
            throw 24;
        }
        
    }
/**
     * This will compile all the chapters to the PDF pipeline.
     * 
     * @param {Array} chapterlist This is the array of chapters of the novel, containing its contents
     * 
     * @throws An error code when an exception occurs
     */
This will compile all the chapters to the PDF pipeline.

@param {Array} chapterlist This is the array of chapters of the novel, containing its contents

@throws An error code when an exception occurs
This will compile all the chapters to the PDF pipeline . @param { Array } chapterlist This is the array of chapters of the novel containing its contents @throws An error code when an exception occurs
compileNovelPages(chapterlist){
        try{
            pretty.logPrint("Compiling novel contents...");
            for(var c = 0; c<chapterlist.length; c++){
                let { chapter, content } = chapterlist[c];
                let { title } = content;
                this.doc.addPage()
                    .fontSize(25)
                    .text(`${title} (${chapter})`, 100, 100)
                    .moveDown()
                for(var p=0; p<content["content"].length; p++){
                    this.doc.fontSize(12)
                        .text(content["content"][p])
                        .moveDown();
                }
            }
            this.doc.end();
            pretty.logWrite("Compiling of novel is done! Check the output on: ");
            pretty.cPrint(`${this.dir}`,"b");
            pretty.lineBreak();
        }
        catch(err){
            console.log(chapterlist)
            errDict.customError(err);
            throw 24;
        }
    }
compileNovelPages ( chapterlist ) { try { pretty . logPrint ( "Compiling novel contents..." ) ; for ( var c = 0 ; c < chapterlist . length ; c ++ ) { let { chapter , content } = chapterlist [ c ] ; let { title } = content ; this . doc . addPage ( ) . fontSize ( 25 ) . text ( ` ${ title } ${ chapter } ` , 100 , 100 ) . moveDown ( ) for ( var p = 0 ; p < content [ "content" ] . length ; p ++ ) { this . doc . fontSize ( 12 ) . text ( content [ "content" ] [ p ] ) . moveDown ( ) ; } } this . doc . end ( ) ; pretty . logWrite ( "Compiling of novel is done! Check the output on: " ) ; pretty . cPrint ( ` ${ this . dir } ` , "b" ) ; pretty . lineBreak ( ) ; } catch ( err ) { console . log ( chapterlist ) errDict . customError ( err ) ; throw 24 ; } }
This will compile all the chapters to the PDF pipeline.
This will compile all the chapters to the PDF pipeline .
// Iterate through the list of chapters where c is the chapters // and the p is your paragraph, this has a time complexity of O(c*p)