Fix import of create_blank_page
This commit is contained in:
parent
03dbe317c5
commit
e3e84692e3
2 changed files with 5 additions and 3 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from pypdf import PaperSize, PdfReader, PdfWriter, Transformation
|
import numpy as np
|
||||||
from pypdf.annotations import Line
|
from pypdf import PaperSize, PdfReader, PdfWriter, Transformation, PageObject
|
||||||
from pypdf.generic import ArrayObject, FloatObject, NameObject
|
from pypdf.generic import ArrayObject, FloatObject, NameObject
|
||||||
|
from pypdf.annotations import Line
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -106,7 +107,7 @@ def blit_to_A4(input_pdf, append_to=PdfWriter()):
|
||||||
writer.add_annotation(front_page, midline)
|
writer.add_annotation(front_page, midline)
|
||||||
|
|
||||||
front = input_pdf.pages[k]
|
front = input_pdf.pages[k]
|
||||||
back = input_pdf.pages[k+1] if (k+1<L) else create_blank_page(None, PaperSize.A5.width, PaperSize.A5.height)
|
back = input_pdf.pages[k+1] if (k+1<L) else PageObject.create_blank_page(None, PaperSize.A5.width, PaperSize.A5.height)
|
||||||
|
|
||||||
front.mediabox = front_page.mediabox
|
front.mediabox = front_page.mediabox
|
||||||
back.mediabox = back_page.mediabox
|
back.mediabox = back_page.mediabox
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ pkgs.mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
(pkgs.python3.withPackages (pythonPackages: with python3Packages; [
|
(pkgs.python3.withPackages (pythonPackages: with python3Packages; [
|
||||||
pypdf
|
pypdf
|
||||||
|
numpy
|
||||||
]))
|
]))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue