Skip to content

antonyoni/TextFromPdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextFromPdf - PowerShell module for extracting text from PDF.

This module can be used to extract text from a PDF. Currently, it only contains a single function that traverses a PDF line-by-line and uses a RuleSet passed as a parameter to extract particular bits of information. It's set up to extract the total, vat, date, and time from receipts.

Available Functions

Function Alias Description
Get-TextFromPdf Extracts text from a PDF using a RuleSet.

Examples

Extract the total, tax, date, and time from a receipt
Get-TextFromPDF -Path 'c:\temp\receipt01.pdf'
Use a custom RuleSet to extract information
$ruleSet = @(
    [pscustomobject]@{
        Name       = "Total"
        Expression = "(?i)Net: ?"
        Function   = {
            return [regex]::Match($text, "\d{1,2}\.\d{2}").Value
        }
    }
)
Get-TextFromPDF -Path '.\receipt01.pdf' -RuleSet $ruleSet

License

AGPL v3 License AGPL v3

About

PowerShell module that uses iText 7 to extract text from PDF.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published