Skip to content

Commit

Permalink
Expose documentTitle option from PrintJS
Browse files Browse the repository at this point in the history
  • Loading branch information
frdij committed Nov 4, 2024
1 parent ed907fa commit 9bff832
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/Append.Blazor.Printing/PrintOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public PrintOptions(string printable, string modalMessage, PrintType printType =
/// </summary>
public PrintType Type { get; init; }
/// <summary>
/// When printing html, image or json, this will be shown as the document title.
/// </summary>
public string DocumentTitle { get; set; } = "Document";
/// <summary>
/// Enable this option to show user feedback when retrieving or processing large PDF files.
/// </summary>
public bool ShowModal { get; init; }
Expand Down
3 changes: 3 additions & 0 deletions source/Append.Blazor.Printing/PrintOptionsAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ internal record PrintOptionsAdapter
{
public string Printable { get; init; }
public string Type { get; init; }
public string DocumentTitle { get; set; } = "Document";
public bool ShowModal { get; init; }
public string ModalMessage { get; init; } = "Retrieving Document...";
public bool? Base64 { get; set; }
Expand All @@ -18,6 +19,8 @@ public PrintOptionsAdapter(PrintOptions options)
{
Printable = options.Printable;
Type = options.Type.ToPrintJsString();
if (!string.IsNullOrWhiteSpace(options.DocumentTitle))
DocumentTitle = options.DocumentTitle;
ShowModal = options.ShowModal;
ModalMessage = options.ModalMessage;
Base64 = options.Base64 == true ? true : null;
Expand Down

0 comments on commit 9bff832

Please sign in to comment.