From 66fddfb2d9fad5b38a5acbf74c6d57db4d58384d Mon Sep 17 00:00:00 2001 From: Rakshit Kumar Singh Date: Fri, 15 Dec 2023 16:24:41 +0000 Subject: [PATCH] merge function --- new-website/utils/tutorials/build_pdf_book.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/new-website/utils/tutorials/build_pdf_book.py b/new-website/utils/tutorials/build_pdf_book.py index aa9b3c6d..b3319186 100644 --- a/new-website/utils/tutorials/build_pdf_book.py +++ b/new-website/utils/tutorials/build_pdf_book.py @@ -21,6 +21,7 @@ import pandas as pd import pdfkit from utils import numeric_sorter +from typing import List INFO_PATH = "/workspaces/deepchem.github.io/new-website/utils/tutorials/website-render-order/" @@ -58,6 +59,21 @@ def merge_pdf(): command = command + PDF_PATH + j[:-5] + "pdf " os.system(command + "merged.pdf") +def merge_pdf_pages(a: List[str]): + """Merges the PDFs. + Usage include adding title page, ending, etc. + + Parameters + ---------- + a: List[str] + List of addresses of pdf to merge. In correct order. + + """ + command = "pdfunite " + for i in a: + command = command + i + ' ' + return command + #os.system(command, "merged.pdf") if __name__ == "__main__": os.system("mkdir " + PDF_PATH)