Skip to content
VeryPDF Knowledge Base

VeryPDF Knowledge Base

Knowledge Base to VeryPDF Products

  • Home
  • Products
    • PDF to Any Converter
      • PDF to Word Converter
      • PDF to Word OCR Converter
      • PDF to Excel Converter
      • PDF to Excel OCR Converter
      • PDF to Text Converter
      • PDF to Text OCR Converter
      • PDF to HTML Converter
      • PDF Extract TIFF
      • PDF to Image Converter
      • PDF to PowerPoint Converter
    • Any to PDF Converter
      • AutoCAD to PDF Converter
      • PCL to PDF Converter
      • Image to PDF Converter
      • Image to PDF OCR Converter
      • HTML to PDF Converter
      • Document Printer
      • Document Converter
      • PowerPoint to Flash Converter
      • PowerPoint Converter
      • Free Text To PDF Converter
      • Metafile To PDF Converter
      • Office to Any Converter
    • PDF Utilities
      • PDFcamp Printer
      • PDF Editor
      • PDF Password Remover
      • Encrypt PDF
      • PDF Stamper
      • PDF Print
      • PDF Form Filler
      • Advanced PDF Tools
      • PDF Split-Merge
      • PDF Size Splitter
      • PDF Manual Splitter
      • PDF Optimizer
      • PDF Crop
      • PDF to PDF/A Converter
      • PDF Batch Print
    • Graphics Tools
      • TIFF Toolkit
      • Raster to Vector Converter
      • PDF to Flash Flip Book Converter
      • Image to Text OCR Converter
    • Business & OCR
      • PDF to Excel Converter
      • PDF to Excel OCR Converter
      • Scan to Excel OCR Converter
      • PDF to Word Converter
      • PDF to Word OCR Converter
      • Scan to Word OCR Converter
      • Office to Any Converter
      • Screen OCR
      • TIFF Toolkit
    • Multimedia
      • Flash to Image Converter
      • PowerPoint to Video Converter
      • Flash to Animated GIF Converter
      • PowerPoint to Flash Converter
      • PowerPoint Converter
    • Virtual Printer
      • PDFcamp Printer
      • Document Printer
      • Document Converter
      • Mini EMF Printer Driver
    • Development
      • Doc Converter COM Component
      • PDF Editor OCX Control
      • PDF to Text Converter SDK
      • Image to PDF Converter SDK
      • Image to PDF OCR Shell
      • HTML Converter Command Line
      • PDF to Image Converter SDK
      • PCL to PDF Converter SDK
      • PDF Password Remover SDK
      • Encrypt PDF SDK
      • PDF Split-Merge SDK
      • PDF Stamp SDK
      • PDF Print SDK
      • PDF Form Filler OCX
      • Advanced PDF Tools SDK
      • PDF Editor Toolkit SDK
      • Document Converter SDK
    • Customization
      • Custom Development Solution
    • More >>
  • Solutions
    • Web Viewer Solution
    • Web Annotator Solution
    • OCR Solution
    • PDF to Office Solution
    • PDF Form Filler Solution
    • Document Security Solution
    • Printer Intercept and Capture
    • PDF Extraction Solution
    • Paperless Printing Solution
    • Document Conversion
    • PDF Digital Signature
    • More >>
  • Blog
    • Advanced PDF Tools
    • docPrint Pro
    • PDFcamp Printer
    • PDF Editor
    • PDF Print
    • OCR Products
    • HTML to PDF Converter
    • PDF to Image Converter
    • Image to PDF Converter
    • PDF to Word Converter
  • Company
    • About Us
    • Contact Us

How to modify Properties and Metadata, such as Title, Author, Subject, Keywords, Creator, CreationDate and ModDate to PDF files using Python Program Language? Manipulate PDFs with Python

Posted on 2020/06/15Author VeryPDF / 2454 Views

How can I read the properties/metadata like Title, Author, Subject and Keywords stored on a PDF file using Python? and How can I set special properties and metadata to PDF files using Python? We often got some questions from our customers, they would like to manipulate their PDF files using Python Program Language.

How to modify Properties and Metadata, such as Title, Author, Subject, Keywords, Creator, CreationDate and ModDate to PDF files using Python Program Language? Manipulate PDFs with Python

Here is a question from our customer in the past,
-----------------------
I'm looking for a very fast, lightweight Python library to read PDF metadata. I don't need any write capabilities. It would be better if only the metadata information is loaded, not the entire file.

I realize an interpreted language like Python isn't the best choice for speed, but as this solution needs to be cross platform and work with an existing Python application there doesn't seem to be much of a choice.

I checked out some Python PDF libraries, but I am ideally looking for something lighter and faster, suitable for processing tens of thousands of files in one go.
-----------------------

Fortunately, VeryUtils has a PythonPDF Library product, it's small and fast enough. This product can be used to manipulate PDF files, such as rotate PDF pages, split and merge PDF files, stamp PDF files and many other functions. With VeryUtils PythonPDF Library product, you can retrieve and set following attributes from/to PDF files easily,

Title
Author
Subject
Keyword
Created Date
Modified Date
Creator
Producer
Trapped

Contact Us for Custom Development Solutions
Response within 24 hours

Please by following steps to use VeryUtils PythonPDF Library,

1. You may buy VeryUtils PythonPDF Library from this web page,

https://veryutils.com/pythonpdf-library-source-code

2. After you buy it, you will get a package with full python source code, VeryUtils PythonPDF Library is a pure Python product, it doesn't require any third party application.

3. Please download PythonPDF Library and unzip it to a folder, such as D:\downloads\python-pdfrw folder,

4. Please run following command line to set the main folder to "PYTHONPATH" environment variable,

set PYTHONPATH=D:\downloads\python-pdfrw

5. Please go to "examples" folder, you can run following command line to test PDF Properties/Metadata modification function,

python alter.py testcmd.pdf

Please look at following screenshot for the modified PDF file,

How to modify Properties and Metadata, such as Title, Author, Subject, Keywords, Creator, CreationDate and ModDate to PDF files using Python Program Language? Manipulate PDFs with Python

6. Please find the sample Python Source Code at below,
-------------------------------
import sys
import os

from pdfrw import PdfReader, PdfWriter

inpfn, = sys.argv[1:]
outfn = 'alter.' + os.path.basename(inpfn)

trailer = PdfReader(inpfn)
trailer.Info.Title = 'My New Title Goes Here'
trailer.Info.Producer = "My Producer";
trailer.Info.Author = "My Author";
trailer.Info.Creator = "My Creator";
trailer.Info.Subject = "My Subject";
trailer.Info.Keywords = "My Keywords";
trailer.Info.CreationDate = 'D:20150803195603Z';
trailer.Info.ModDate = 'D:20150803195603Z';
PdfWriter(outfn, trailer=trailer).write()
-------------------------------

If you have any question for VeryUtils Python library product, please feel free to let us know, we are glad to assist you asap.

https://veryutils.com/pythonpdf-library-source-code

Contact Us for Custom Development Solutions
Response within 24 hours

Related Posts

  • How to extract some PDF pages from a PDF file and save to a new PDF file using Python?
  • How to Add Custom Fields to PDF Files Using VeryPDF PDFTools (And Avoid Common Errors), with an emphasis on troubleshooting the issue of corrupted PDF files and field visibility in PDF viewers like Adobe Acrobat and NitroPDF Pro
  • VeryPDF PDF SDK for Developers: Built for Developers, Trusted by Enterprises! Powerful PDF Toolkit for Developers to Edit, Convert, Sign, Secure, and Automate PDF Documents
  • Advanced PDF Tools cannot change Created Date and ModifyDate files
  • ASA Text Report to PDF Conversion: Preserve Carriage Control, Monospaced Formatting, and Payroll Report Layouts
  • Understanding Windows SPL and SHD Files and How to Convert Them to PDF with VeryPDF SPL to PDF Converter Command Line
  • How to Convert PostScript Files to PDF and Add Barcodes/QR Codes Using VeryPDF PostScript to PDF Converter and PDFStamp Command Line SDK Tools
  • How to Reliably Replace Text in PDF Files with VeryPDF PDF Text Replacer Command Line (pdftr.exe)
  • [Solution] VeryPDF Document Conversion and Automation Service – Optimize PDF Workflows, Batch File Processing, and Compliance at Scale
  • How to Solve Issues with -detach-embedded-files in VeryPDF PDF Extract Tool
  • I would like to purchase a New License of VeryPDF Toolbox for AIX server.
  • How does Hookprinter intercept data which is sent to a printer? Does the print job passes through the hookprinter to be manipulated or does it simply sniffs raw data sent to the printer?
  • VeryPDF PDF Extract: Unlocking Structured Data from PDFs
  • PDF SDK for C/C++ Developers to manage and print PDF files
  • Batch Extracting and removing attachments from pdf

Related posts:

The best way to convert XML, XHTML, HTML to PDF in your web apps
How to increase the header margins in html2any app?
Use HookPrinter SDK to capture print jobs from special EXE processes
Streamline Your Document Workflow with VeryPDF Conversion Service
Introducing VeryPDF Dummy Network Shared Printer Solution
VeryPDF Document Converter Software Converts Word, DOC, DOCX, PDF, WPS, HTML, RTF, XLS, XLS, Excel a...
VeryPDF PDF to Office Conversion SDK for Developers Royalty Free
Integrating VeryPDF PDF to DWG Command-Line Product into Your Software Royalty Free
Category: @VeryPDF SDK & COM & CLI Tag: modify date, modify pdf, modify pdf document properties, pdf metadata, pdf properties, python pdf, python pdf library, pythonpdf

Post navigation

Previous PostFile not Found PDF2Txt.dll problem with PDF to Text Converter SDK product
Next PostEMF to PDF SDK or Command Line

Custom Development Services

VeryPDF offers customized development services to meet your unique business needs, including PDF Processing, Document Automation, Document Analysis, Format Conversion, OCR, DRM, Barcode Solutions, Virtual Printer, Digital Signature, AI Integration, and more. Contact us today to get a personalized solution!

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • VeryPDF.com
  • VeryDOC.com
  • VeryUtils.com
  • imPDF.com

Recent Solutions

  • image_thumb.png[Solution] Secure Redaction of PII and Sensitive Data from PDFs Without Clo…
  • image_thumb.png[Solution] VeryPDF AI-Powered Smart Redact Server Solution: Permanently Rem…
  • image_thumb.png[Solution] VeryPDF SDK for Android Platform: Offline PDF Viewer, Editor, An…
  • image_thumb.png[Solution] VeryPDF Text to PDF Converter: The Complete Solution for Convert…
  • image_thumb.png[Solution] VeryPDF PDF Redaction Solution: Securely Remove Sensitive Conten…

Recent Posts

  • image_thumb.png[Solution] Secure Redaction of PII and Sensitive Data from PDFs Without Clo…
  • image_thumb.pngMigrating PDF Solutions for Linux: Transitioning from 32-bit PDF Toolbox Co…
  • c741fafe-a19a-405c-b8a0-04fc07161d0d.pngWhy Apryse Users Should Consider Switching to VeryPDF Smart Redact Server f…
  • 0215d862-d9d4-47da-9ed4-94dbedfdc41a.pngVeryPDF Smart Redact Server vs Foxit PhantomPDF Faster, Safer, and Fully Of…
  • 29a17eec-631c-48f8-b935-69ab48eeed8e.pngComparing Nitro PDF and VeryPDF Smart Redact Server Which Redaction Tool Me…

Categories

Archives

Calendar

June 2020
M T W T F S S
« May   Jul »
1234567
891011121314
15161718192021
22232425262728
2930  
© 2026 VeryPDF Knowledge Base / VeryPDF.com / VeryDOC.com / VeryUtils.com / Support
Contact
Us