< Back

Merge-Pdf

Sat Jan 18, 2020 11:37 am

NAME Merge-Pdf



SYNOPSIS

Merges multiple pdf files into one





SYNTAX

Merge-Pdf [[-Path] <String[]>] [[-OutputPath] <String>] [-Append] [-Force] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

Merge-Pdf cmdlet joins all the pages of provided pdf files into one pdf. If no OutputPath value provided it

creates Merged.pdf in current location.





PARAMETERS

-Path <String[]>



Required? false

Position? 1

Default value .

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-OutputPath <String>



Required? false

Position? 2

Default value Merged.pdf

Accept pipeline input? false

Accept wildcard characters? false



-Append [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Array of PowerShell Paths, output path for the result





OUTPUTS

Merge-Pdf does not return any output. There can be error, warning or verbose messages.





NOTES





The cmdlet uses PdfSharp library available under MIT licence.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Merge-Pdf



Gets all .PDF files in current location and merges them into .\\Merged.pdf









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Merge-Pdf -OutputPath c:\\output\\out.pdf -Path c:\\input\\in.pdf -Append



Appends in.pdf to out.pdf









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Merge-Pdf -OutputPath c:\\output\\out.pdf



Merges all .PDF files in current location into c:\\output\\out.pdf









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Merge-Pdf -Path c:\\input\\ -OutputPath c:\\output\\out.pdf



Merges all .PDF files in folder c:\\input into c:\\output\\out.pdf









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>'c:\\input\\file1.pdf', 'c:\\input\\file2.pdf' | Merge-Pdf -OutputPath c:\\output\\out.pdf



Merges .PDF files provided from pipeline into c:\\output\\out.pdf











RELATED LINKS