API Reference

Cmdlet

Get-OfficePdfAttachment

Namespace PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Pdf.PdfExtractedAttachment System.IO.FileInfo

Gets or extracts embedded file attachments from a PDF.

Remarks

Gets or extracts embedded file attachments from a PDF.

Examples

Authored help example

List and extract embedded PDF attachments.

PS>


$proof = @(
                Get-OfficePdfAttachment -Path .\Examples\Documents\PdfWithAttachment.pdf
                Get-OfficePdfAttachment -Path .\Examples\Documents\PdfWithAttachment.pdf -OutputDirectory .\Examples\Documents\Attachments
            )
            $proof
        

First returns attachment metadata, then writes embedded files to disk.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Get-OfficePdfAttachment [-Name <String>] [-OutputDirectory <String>] [-Password <String>] -Path <String> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Name String optionalposition: namedpipeline: False
Optional attachment name or file name filter.
OutputDirectory String optionalposition: namedpipeline: False
Optional directory where attachments should be written.
Password String optionalposition: namedpipeline: False
Password used to read a Standard password-encrypted PDF.
Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath
PDF file path.

Outputs

OfficeIMO.Pdf.PdfExtractedAttachment System.IO.FileInfo