简体   繁体   English

如何从元数据中找到 PDF 的标题?

[英]How to find the title for a PDF from the metadata?

How can I get the title for a PDF file after having renamed the file itself?重命名文件本身后,如何获取PDF文件的标题?

PSPath              : Microsoft.PowerShell.Core\FileSystem::/home/nicholas/to/99.pdf
PSParentPath        : Microsoft.PowerShell.Core\FileSystem::/home/nicholas/to
PSChildName         : 99.pdf
PSDrive             : /
PSProvider          : Microsoft.PowerShell.Core\FileSystem
PSIsContainer       : False
Mode                : -----
ModeWithoutHardLink : -----
VersionInfo         : File:             /home/nicholas/to/99.pdf
                      InternalName:     
                      OriginalFilename: 
                      FileVersion:      
                      FileDescription:  
                      Product:          
                      ProductVersion:   
                      Debug:            False
                      Patched:          False
                      PreRelease:       False
                      PrivateBuild:     False
                      SpecialBuild:     False
                      Language:         
                      
BaseName            : 99
Target              : 
LinkType            : 
Length              : 592483
DirectoryName       : /home/nicholas/to
Directory           : /home/nicholas/to
IsReadOnly          : False
FullName            : /home/nicholas/to/99.pdf
Extension           : .pdf
Name                : 99.pdf
Exists              : True
CreationTime        : 2/19/2021 11:45:18 PM
CreationTimeUtc     : 2/20/2021 7:45:18 AM
LastAccessTime      : 2/20/2021 2:02:36 AM
LastAccessTimeUtc   : 2/20/2021 10:02:36 AM
LastWriteTime       : 2/19/2021 11:45:18 PM
LastWriteTimeUtc    : 2/20/2021 7:45:18 AM
Attributes          : Normal


PS /home/nicholas/to> 
PS /home/nicholas/to> Get-ChildItem -Path ./ –File | Select-Object -Property *

This is to bulk import PDF files into calibre , which, notably, seems to recognize duplicates and even displays some titles.这是将PDF文件批量导入到calibre中,尤其是它似乎可以识别重复项,甚至显示一些标题。 Is it parsing the PDF file itself, or gleaning this from meta -data?它是在解析PDF文件本身,还是从数据中收集?

For this, you can use pdfinfo.exe which you can find as part of the free Xpdf command line tools .为此,您可以使用pdfinfo.exe ,您可以在免费的Xpdf 命令行工具中找到它。

After you have downloaded and extracted the zip file, copy pdfinfo.exe to some directory and make sure you unblock it, either by right-click or by using PowerShell下载并解压 zip 文件后,将pdfinfo.exe复制到某个目录并确保通过右键单击或使用 PowerShell 取消阻止它

Unblock-File -Path 'Where\Ever\You\Have\Copied\It\To\pdfinfo.exe'

Using that, to get the original title as stored in the pdf, you do使用它,要获得存储在 pdf 中的原始标题,您可以

$title = ((& 'D:\Test\pdfinfo.exe' 'D:\Test\test.pdf' | 
    Where-Object { $_ -match '^Title:' }) -split ':', 2)[-1].Trim()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Powershell 从给定 url 获取网站元数据,例如标题、描述 - Get website metadata such as title, description from given url using Powershell Active Directory:如何找到具有相同标题的用户的位置并复制它? - Active Directory : how to find the location of a user with the same title and copy it? 如何从 powershell 获取 SharePoint 中的元数据(列值) - How to get metadata(Column Value) in SharePoint from powershell 有没有办法使用powershell在文件夹上找到“元数据” - Is there any way to find 'metadata' on folders using powershell Powershell - 从文本中删除元数据 - Powershell - remove metadata from text 如何从标题中获取电视节目集和会话编号 - How to get tv show episode and session number from title 如何通过职称从powershell查询GAL? - How does one query the GAL from powershell by job title? 如何防止控制台标题被另一个应用程序更改 - How to prevent the console title from being changed by another application 如何从 object 中获取没有标题的 powershell 中的项目? - How can I get an item from an object without title in powershell? 如何使用PowerShell / RegEx查找空白的所有HTML文件 <title>标签? - How to use PowerShell/RegEx to find all HTML files with empty <title> tag?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM