Skip to content

Commit

Permalink
Merge pull request #71 from by-pinja/fix/pdf-width-height
Browse files Browse the repository at this point in the history
Fixed pdf width and height properties name match documentation
  • Loading branch information
samikaur authored Nov 17, 2022
2 parents 4e090e0 + e392dd1 commit 42dceac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Pdf/PdfQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@ await page.SetContentAsync(html,
WaitUntil = new[] { WaitUntilNavigation.Load, WaitUntilNavigation.DOMContentLoaded }
});

var width = options.GetValue("width", StringComparison.OrdinalIgnoreCase);
var height = options.GetValue("height", StringComparison.OrdinalIgnoreCase);

var defaultPdfOptions = new PdfOptions
{
Format = options.ContainsKey("Width") && options.ContainsKey("Height") ?
Format = width != null && height != null ?
new PaperFormat(
options["Width"].Value<decimal>(),
options["Height"].Value<decimal>()
width.Value<decimal>(),
height.Value<decimal>()
) :
PaperFormat.A4
};
Expand Down

0 comments on commit 42dceac

Please sign in to comment.