3
25
Fork
You've already forked fpdf
10

Implementing page x of y #51

Open
opened 2023年09月18日 04:14:37 +02:00 by kharabela · 1 comment
kharabela commented 2023年09月18日 04:14:37 +02:00 (Migrated from github.com)
Copy link

I tried to implement page x of y on 7 page pdf.
Instead of getting 1/7 . I am getting 1/1 upto 7/7.Please suggest what to implement
pdf.CellFormat(0, 10, fmt.Sprintf("Page %d/%d", pdf.PageNo(), pdf.PageCount()), "", 0, "C", false, 0, "")

I tried to implement page x of y on 7 page pdf. Instead of getting 1/7 . I am getting 1/1 upto 7/7.Please suggest what to implement pdf.CellFormat(0, 10, fmt.Sprintf("Page %d/%d", pdf.PageNo(), pdf.PageCount()), "", 0, "C", false, 0, "")
esmin commented 2024年01月04日 03:33:50 +01:00 (Migrated from github.com)
Copy link

pdf.AliasNbPages("{nb}")
pdf.CellFormat(0, 10, fmt.Sprintf("Page %d/{nb}", pdf.PageNo()), "", 0, "C", false, 0, "")

pdf.AliasNbPages("{nb}") pdf.CellFormat(0, 10, fmt.Sprintf("Page %d/{nb}", pdf.PageNo()), "", 0, "C", false, 0, "")
Sign in to join this conversation.
No Branch/Tag specified
main
v0.12.0
v0.11.1
v0.10.0
v0.11.0
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v1.4.3
v0.4.1
v0.4.0
v0.3.1
v0.3.0
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
go-pdf/fpdf#51
Reference in a new issue
go-pdf/fpdf
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?