Difference between revisions of "Pdfcpu"

From COPTR
Jump to navigation Jump to search
(Created page with "<!-- Use the structure provided in this template, do not change it! --> {{Infobox_tool |purpose=A Go library and command line tool for PDF processing incl. validation |image=...")
 
(Input Format)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- Use the structure provided in this template, do not change it! -->
+
{{Infobox tool
 
+
|image=pdfcpuLogoSmall.png
{{Infobox_tool
 
 
|purpose=A Go library and command line tool for PDF processing incl. validation
 
|purpose=A Go library and command line tool for PDF processing incl. validation
|image={{PAGENAMEE}}.png
 
 
|homepage=https://pdfcpu.io/
 
|homepage=https://pdfcpu.io/
|license=Apache-2.0 License  
+
|license=Apache-2.0 License
|platforms=
+
|formats_in=PDF
 +
|function=Metadata Extraction, Validation
 +
|content=Document
 
}}
 
}}
<!-- Note that to use the image field, you should leave the value as {{PAGENAMEE}}.png (or similar) and upload a copy of the image. Hot-linking is not supported. If you don't want an image, just remove that line. -->
+
{{Infobox tool details}}
 
 
<!-- Add one or more categories to describe the function of the tool, such as:
 
[[Category:Validation]]
 
[[Category:Metadata Extraction]]
 
[[Category:Metadata Extraction]]
 
 
 
<!-- Add relevant categories to describe the content type that the tool addresses, such as:
 
[[Category:Document]]
 
 
 
 
 
 
 
 
== Description ==
 
== Description ==
 
<!-- Describe the what the tool does, focusing on it's digital preservation value. Keep it factual. -->
 
<!-- Describe the what the tool does, focusing on it's digital preservation value. Keep it factual. -->
Line 89: Line 78:
  
 
<!-- Add the OpenHub.com ID for the tool, if known. -->
 
<!-- Add the OpenHub.com ID for the tool, if known. -->
{{Infobox_tool_details
 
|releases_rss=
 
|issues_rss=
 
|mailing_lists=
 
|ohloh_id=
 
}}
 

Latest revision as of 12:08, 19 October 2021



Pdfcpu
A Go library and command line tool for PDF processing incl. validation
Homepage:https://pdfcpu.io/
License:Apache-2.0 License
Input Formats:PDF
Function:Metadata Extraction,Validation
Content type:Document
Appears in COW:Validation Error Analysis and Treatment for PDF-hul 122 Invalid destination - Destination NULL, Validation Error Analysis and Treatment for PDF-hul 133 Invalid date




Description[edit]

pdfcpu is a powerful Go library and command line tool that supports many PDF processing functions such as reading and writing the xref table, extracting images, fonts and embedded file attachments and encryption detection as well as decryption. A full list of the command set is avaiable at: https://pdfcpu.io/about/command_set

Validation[edit]

pdfcpu validates PDFs up to version 1.7. There are two different levels of validation, strict and relaxed, and the option to run validation in verbose mode which shows the output of the entire PDF syntax.

pdfcpu validate -mode strict this.pdf
validating(mode=strict) this.pdf ...
validation error (try -mode=relaxed): dict=type1FontDict required entry=FirstChar missing
pdfcpu validate -mode relaxed this.pdf
validating(mode=relaxed) this.pdf ...
validation ok

Metadata Extraction[edit]

Extraction of Metadata is possible in two ways. The argument info prints Information such as title, author, PDF producer, creation / modification data and some technical metadata such as encryption and permission information and whether the PDF is tagged, linearized or includes watermarks. Sample output:

pdfcpu info this.pdf
        PDF version: 1.6
         Page count: 96
          Page size: 21.00 x 29.70 cm
   .........................................
              Title: This is just a test
             Author: Digiman
            Subject: 
       PDF Producer: Adobe PDF Library 15.0
    Content creator: Adobe InDesign CC 207 (Macintosh)
      Creation date: D:20190912181416+02'00'
  Modification date: D:20190918120753+02'00'
           Keywords: key1
                     key2
   ..........................................
             Tagged: Yes
             Hybrid: No
         Linearized: No
 Using XRef streams: Yes
 Using object streams: Yes
         Watermarks: No
   ..........................................
          Encrypted: No
        Permissions: Full access

The second option is to extract any embedded metadata via the extract -mode meta flags. This creates txt files with the extracted metadata entries in a specified directory. Sample output:

pdfcpu extract -mode meta this.pdf mdout
  extracting metadata from this.pdf into mdout/ ...
  writing mdout\this_Metadata_XObject_6499_6500.txt
  writing mdout\this_Metadata_unknown_401_33.txt
  writing mdout\this_Metadata_XObject_292_289.txt
  writing mdout\this_Metadata_Catalog_6455_385.txt
  writing mdout\this_Metadata_XObject_291_290.txt
  writing mdout\this_Metadata_unknown_6491_6475.txt


User Experiences[edit]

Development Activity[edit]

pdfcpu has an active user and developer community. All activity can be viewed via the github repo: https://github.com/pdfcpu/pdfcpu