Cmdlet
Optimize-OfficePdf
Writes a smaller or sanitized copy of a PDF.
Syntax
Optimize-OfficePdf
[-AllowLarger]
[-IgnorePermissionRestrictions]
[-KeepDuplicateStream]
[-KeepUnreferencedObject]
[-LoadOptions <PdfLoadOptions>]
[-MinimumStreamCompressionSize <Int32>]
[-NoClobber]
[-NoCompressStream]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]#Parameter set:
PathOptimize-OfficePdf
[-AllowLarger]
[-IgnorePermissionRestrictions]
[-KeepDuplicateStream]
[-KeepUnreferencedObject]
[-LoadOptions <PdfLoadOptions>]
[-MinimumStreamCompressionSize <Int32>]
[-NoClobber]
[-NoCompressStream]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]#Parameter set:
PathDirectoryOptimize-OfficePdf
[-AllowLarger]
[-IgnorePermissionRestrictions]
[-KeepDuplicateStream]
[-KeepUnreferencedObject]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-MinimumStreamCompressionSize <Int32>]
[-NoClobber]
[-NoCompressStream]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[<CommonParameters>]#Parameter set:
LiteralPathOptimize-OfficePdf
[-AllowLarger]
[-IgnorePermissionRestrictions]
[-KeepDuplicateStream]
[-KeepUnreferencedObject]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-MinimumStreamCompressionSize <Int32>]
[-NoClobber]
[-NoCompressStream]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[<CommonParameters>]#Parameter set:
LiteralPathDirectoryExamples
Use the native OfficePdf command.
Optimize-OfficePdf -Path .\Reports\Annual-Report.pdf -OutputPath .\Reports\Annual-Report-Small.pdfParameters
- -AllowLarger SwitchParameter
- AllowLarger for this operation.
- -IgnorePermissionRestrictions SwitchParameter
- After successful authentication only; never bypasses a missing password.
- -KeepDuplicateStream SwitchParameter
- KeepDuplicateStream for this operation.
- -KeepUnreferencedObject SwitchParameter
- KeepUnreferencedObject for this operation.
- -LoadOptions PdfLoadOptions
- LoadOptions for this operation.
- -MinimumStreamCompressionSize Int32
- MinimumStreamCompressionSize for this operation.
- -NoClobber SwitchParameter
- NoClobber for this operation.
- -NoCompressStream SwitchParameter
- NoCompressStream for this operation.
- -OutputPath String
- OutputPath for this operation.
- -PassThru SwitchParameter
- PassThru for this operation.
- -Password SecureString
- Argument transformation also accepts a plain string (with a warning) or a PSCredential (its password).
- -Path String[]
- Path for this operation.
- -OutputDirectory String
- OutputDirectory for this operation.
- Hidden-data categories that -Sanitize removes, from New-OfficeHiddenDataOptions or a hashtable such as @{ Kinds = 'ActiveContent, Attachments, DocumentProperties' }. Defaults to attachments and active content: scripts, unsafe actions and links, and rich media.
- -Sanitize SwitchParameter
- Sanitize for this operation.
- -LiteralPath String[]
- LiteralPath for this operation.
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.