This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import pikepdf | |
| import argparse | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('input') | |
| parser.add_argument('output') | |
| parser.add_argument('--pagelayout', type=str, default='TwoPageRight', choices=['SinglePage', 'OneColumn', 'TwoColumnLeft', 'TwoColumnRight', 'TwoPageLeft', 'TwoPageRight']) | |
| parser.add_argument('--direction', type=str, default='R2L', choices=['L2R', 'R2L']) | |
| args = parser.parse_args() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import reportlab | |
| from reportlab.lib.units import mm | |
| from reportlab.pdfbase import pdfmetrics | |
| from reportlab.pdfbase.ttfonts import TTFont | |
| from reportlab.pdfgen import canvas | |
| from PyPDF2 import PdfFileWriter, PdfFileReader | |
| from io import BytesIO |