Skip to content
Discussion options

You must be logged in to vote

Thank u for your response! Everything works well, so finally I use this implementation:

def overlay_pdfs(empty_path: str, only_text_path: str, merge_result_path: str):

    with fitz.open(only_text_path) as doc_text:
        with fitz.open(empty_path) as doc_background:

            doc = fitz.open()

            for i in range(doc_background.page_count):
                page_back = doc_background.load_page(i)

                rot = page_back.rotation
                rect = page_back.rect
                w, h = rect.br

                page_back.set_rotation(0)
                new_page = doc.new_page(width=w, height=h)
                new_page.show_pdf_page(new_page.rect, doc_background, n…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by PasaOpasen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants