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 / 3159 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
  • PDF/A-3 vs ZUGFeRD: Custom PDF to PDF/A e-Invoice Development with VeryPDF
  • Custom PDF to PDF/A-3 + ZUGFeRD Development by VeryPDF (Simple Guide for Businesses)
  • 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)
  • Extract embedded fonts from PDF to External TTF TrueType font files using VeryPDF PDF Font Extractor Command Line
  • Convert PDF to Office Formats with VeryPDF PDF to Office Conversion SDK to Developers Royalty Free
  • How to use QR Code to open a password protected PDF file? How to use QR Code to protect a PDF file better? PDF QR Code for PDF Paid Subscription solution.
  • How to get VeryPDF Printer Capturer?
  • How to add a reference to SPLtoPDFCom from "SPL to PDF Converter SDK" C# or VB.NET Windows Application?

Related posts:

How do I capture a spool file from a Windows print queue?
Interested to buy - Royalty Free Developer License for PDF Annotator SDK ActiveX for C#.NET
PDF Reader Source Code License for iOS and Android mobile platforms
Transform Your Scanned Documents with VeryPDF Document Processing: OCR, Batch Splitting, Blank Page ...
VeryPDF Black Border Removal SDK: Automatic Border Detection and Removal for Improved Image Quality
How to convert printing text data and Spool files to TEXT or CSV files?
VeryPDF Royalty Free OCR SDK is an Affordable OCR SDK for Developers
VeryPDF PDF Extractor SDK: A Comprehensive Solution for Data Extraction and Document Conversion
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.pngCapture PostScript and PCL print jobs sent via TCP/IP, save PRN or SPL file…
  • image_thumb.pngHow to Build a Python Network Virtual Printer and Batch Convert Print files…
  • image_thumb.pngVirtual PDF Printer Capture: Capture Windows Print Jobs and Save Them as PD…
  • image_thumb.pngPDF/A-3 vs ZUGFeRD: Custom PDF to PDF/A e-Invoice Development with VeryPDF
  • image_thumb.pngCustom PDF to PDF/A-3 + ZUGFeRD Development by VeryPDF (Simple Guide for Bu…

Recent Posts

  • image_thumb.pngCapture PostScript and PCL print jobs sent via TCP/IP, save PRN or SPL file…
  • image_thumb.pngHow to Build a Python Network Virtual Printer and Batch Convert Print files…
  • image_thumb.pngVirtual PDF Printer Capture: Capture Windows Print Jobs and Save Them as PD…
  • image_thumb.pngHow to Automatically Convert PDF Customer Orders to Excel Using PDF to Exce…
  • image_thumb.pngPrint Management Software Needs PCL Preview? How to Convert PCL to PDF or I…

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