Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletConvertHTMLToPDF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ private static class ParameterSetNames

/// <summary>Path to an HTML file.</summary>
[Parameter(Mandatory = true, ParameterSetName = ParameterSetNames.File)]
[ValidateNotNullOrEmpty]
public string FilePath { get; set; }

/// <summary>Output PDF path.</summary>
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty]
public string OutputFilePath { get; set; }

/// <summary>Open the PDF after creation.</summary>
Expand Down
1 change: 1 addition & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletConvertPDFToText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
/// <summary>Path to the PDF file.</summary>
[Parameter(Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
[Alias("FullName")]
[ValidateNotNullOrEmpty]
public string FilePath { get; set; } = string.Empty;

/// <summary>Pages to extract.</summary>
Expand All @@ -56,7 +57,7 @@

/// <summary>Optional output file.</summary>
[Parameter]
public string? OutFile { get; set; }

Check warning on line 60 in Sources/PSWritePDF/Cmdlets/CmdletConvertPDFToText.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

protected override void ProcessRecord()
{
Expand Down
1 change: 1 addition & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletGetPDF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class CmdletGetPDF : PSCmdlet
{
/// <summary>Path to the PDF file.</summary>
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
[ValidateNotNullOrEmpty]
public string FilePath { get; set; } = null!;

/// <summary>Ignore document protection.</summary>
Expand Down
2 changes: 2 additions & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletMergePDF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ public class CmdletMergePDF : PSCmdlet
{
/// <summary>Paths to PDF files to merge.</summary>
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty]
public string[] InputFile { get; set; }

/// <summary>Path for the merged output.</summary>
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty]
public string OutputFile { get; set; }

/// <summary>Ignore protection on input files.</summary>
Expand Down
1 change: 1 addition & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletNewPDF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class CmdletNewPDF : PSCmdlet {

/// <summary>Output file path.</summary>
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty]
public string FilePath { get; set; } = string.Empty;

/// <summary>PDF version to use.</summary>
Expand Down
1 change: 1 addition & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletNewPDFImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace PSWritePDF.Cmdlets;
public class CmdletNewPDFImage : PSCmdlet {
/// <summary>Path to the image file.</summary>
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty]
public string ImagePath { get; set; } = string.Empty;
/// <summary>Desired image width.</summary>
[Parameter] public int Width { get; set; }
Expand Down
1 change: 1 addition & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletRegisterPDFFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class CmdletRegisterPDFFont : PSCmdlet

/// <summary>Path to the font file.</summary>
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty]
public string FontPath { get; set; } = string.Empty;

/// <summary>Optional encoding for the font.</summary>
Expand Down
2 changes: 2 additions & 0 deletions Sources/PSWritePDF/Cmdlets/CmdletSplitPDF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ public class CmdletSplitPDF : PSCmdlet
[Parameter(Mandatory = true, ParameterSetName = SplitCountParameterSet)]
[Parameter(Mandatory = true, ParameterSetName = PageRangeParameterSet)]
[Parameter(Mandatory = true, ParameterSetName = BookmarkParameterSet)]
[ValidateNotNullOrEmpty]
public string FilePath { get; set; }

/// <summary>Destination folder for split files.</summary>
[Parameter(Mandatory = true, ParameterSetName = SplitCountParameterSet)]
[Parameter(Mandatory = true, ParameterSetName = PageRangeParameterSet)]
[Parameter(Mandatory = true, ParameterSetName = BookmarkParameterSet)]
[ValidateNotNullOrEmpty]
public string OutputFolder { get; set; }

/// <summary>Base name for output files.</summary>
Expand Down
Loading