Skip to content

Instantly share code, notes, and snippets.

@zgulde
Created June 8, 2022 13:32
Show Gist options
  • Save zgulde/d50faf12dbe66722c3cc8f35bc211e01 to your computer and use it in GitHub Desktop.
Save zgulde/d50faf12dbe66722c3cc8f35bc211e01 to your computer and use it in GitHub Desktop.

Updating a PDF title

First install the pdfrw library.

pip install pdfrw

Then use the code block below to udpate the title. You'll need to edit the code to use the correct filepath for your resume and your desired title.

import pdfrw

# Read the existing pdf
document = pdfrw.PdfReader('my_resume.pdf')
# Change the title (or any other metadata)
document.Info.Title = "A new title"
# save the file
pdfrw.PdfWriter('my_resume.pdf', trailer=document).write()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment