Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8678977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:51:27+00:00 2026-06-12T20:51:27+00:00

When i merge several Pdf pages using PyPdf into one single page using mergeTranslatedPage

  • 0

When i merge several Pdf pages using PyPdf into one single page using mergeTranslatedPage, i got some unknown characters, these unknown squares are the characters not included in the last merged page, after some research i think that the method _merge_ressources not working very well , because the later page could overwrite the ressources of the older pages , i tried page1.compressContentStreams() after each merge but without a result.

in this link you will see an example of the PDF that has been merged and the PDF result.

Any help please

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:51:28+00:00Added an answer on June 12, 2026 at 8:51 pm

    The below solutions uses the pdfjam command to merge multiple pdf pages into a single pdf page. It’s a very powerful command with many different options and good documentation. I tested the solution on the two files you’ve provided 4_P7.pdf and 4_P13.pdf. You can view the merged.pdf to verify that all characters are formatted correctly. The code below uses a 2×2 grid by default but you can change that by setting the grid argument when you call merge.

    from subprocess import check_output
    
    def merge(inputs, output, grid='2x2'):
        check_output(['pdfjam'] + inputs + ['--nup', grid, '--outfile', output])
    
    merge(['4_P7.pdf', '4_P13.pdf'], 'merged.pdf')
    

    There was a question in the comment below as to whether custom positions can be done as is the case in the questions example file. The same layout that was provided in the question is implemented below. It first constructs the top layout which is a 4×2 layout, then the bottom 2×6 layout, then finally merges these two layouts into final.pdf. The pdfs used in the below example can be found here.

    from subprocess import check_output
    
    def merge(inputs, output, grid='2x2'):
        return check_output(['pdfjam'] + inputs + ['--nup', grid, '--outfile', output])
    
    files = ['1.pdf', '2.pdf', '3.pdf', '4.pdf', '1.pdf', '2.pdf', '3.pdf', '4.pdf']
    merge(files, 'top.pdf', '4x2')
    
    files = ['1.pdf', '2.pdf', '3.pdf', '4.pdf', '5.pdf', '6.pdf', '1.pdf', '2.pdf',
        '3.pdf', '4.pdf', '5.pdf', '6.pdf']
    merge(files, 'bottom.pdf', '2x6')
    
    merge(['top.pdf', 'bottom.pdf'], 'final.pdf', '1x2')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to merge several rows into a single row using Excel. I
I'm using iTextSharp to merge a number of pdf files together into a single
What's the easiest way to merge the contents of several MP3 files into one
I've got several tables that I want to merge for one big query. The
I am trying to merge several data.frames into one data.frame . Since I have
I have several apps that I'm trying to merge into a single suite: 2
I have several pdf files of some lecture slides. I want to do the
I need merge several RTF documents by PHP. Styles, fonts, page sizes of all
I want to merge all the files in a directory into one. However I
Is it possible to modify several tables, using the merge function in Oracle? In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.