From c88a704840a2ac4fba259c3176a1702ac85da4dc Mon Sep 17 00:00:00 2001 From: dickreckard Date: Wed, 14 Dec 2022 00:57:11 +0100 Subject: [PATCH] page numrebs! --- pdf-compile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdf-compile.py b/pdf-compile.py index f581a70..63c8b0a 100755 --- a/pdf-compile.py +++ b/pdf-compile.py @@ -99,6 +99,9 @@ for chapter in chapters: preview = requests.get(chapter.replace('pad/','preview.html')) style = requests.get(chapter.replace('pad/','stylesheet.css')) + if page > 0: + style+='@page:first { counter-increment: page '+page+'; }' + stylefile=localhost+'.'+name+'/stylesheet.css' with open(stylefile, 'w') as file: file.write(style.text) @@ -132,7 +135,7 @@ for chapter in chapters: outputs.append(localhost+pdffile) counter+=1 - pages=pages+pypdftk.get_num_pages(localhost+pdffile) + page=page+pypdftk.get_num_pages(localhost+pdffile) # compiling all the files in one big pdf!