Skip to content

bug on pageNumber when pageCount=1 #3

@hkandie

Description

@hkandie

There is a bug when the pageCount=0, even on example-1. Calling header.pageIndex() return 2 instead of 1.

var MyDoc = FPDF.Doc.extend({
            Page: FPDF.Page.extend({
                defaultCss:{
                    padding:[30,18,20,24],
                    lineHeight:1.4
                },
                header:function(){
                    this.css({
                            top:15,
                            fontSize:8,
                            textAlign:'right'
                        })
                        .text(Date);
                },
                footer:function(){
                    var header = this;

                    this.css({
                            top:280,
                            fontSize:10,
                            padding:1,
                            textAlign:'center'
                        })
                        .text(function(){
                            return 'Seite ' +
                                header.pageIndex() + 
                                ' von ' + 
                                header.pageCount()
                        })

                }
            })
        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions