diff --git a/AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1 b/AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1 index 52ead84..7f17b49 100644 --- a/AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1 +++ b/AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1 @@ -12,7 +12,7 @@ RootModule = 'AsBuiltReport.Diagram.psm1' # Version number of this module. - ModuleVersion = '1.0.7' + ModuleVersion = '1.0.8' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/AsBuiltReport.Diagram/Src/Private/Add-HtmlNodeTable.ps1 b/AsBuiltReport.Diagram/Src/Private/Add-HtmlNodeTable.ps1 index 5215f85..11d66f7 100644 --- a/AsBuiltReport.Diagram/Src/Private/Add-HtmlNodeTable.ps1 +++ b/AsBuiltReport.Diagram/Src/Private/Add-HtmlNodeTable.ps1 @@ -120,6 +120,12 @@ function Add-HtmlNodeTable { .PARAMETER SubgraphIconHeight Allow to set a subgraph icon height. + .PARAMETER IconWidth + Allow to set the icon width. When combined with IconHeight, the icon's table cell is fixed to that size and the image is scaled to fit. + + .PARAMETER IconHeight + Allow to set the icon height. When combined with IconWidth, the icon's table cell is fixed to that size and the image is scaled to fit. + .PARAMETER TableBackgroundColor Allow to set a table background color (Hex format EX: #FFFFFF). @@ -400,6 +406,18 @@ function Add-HtmlNodeTable { )] [string] $SubgraphIconHeight, + [Parameter( + Mandatory = $false, + HelpMessage = 'Allow to set the icon width' + )] + [string] $IconWidth, + + [Parameter( + Mandatory = $false, + HelpMessage = 'Allow to set the icon height' + )] + [string] $IconHeight, + [Parameter( Mandatory = $false, HelpMessage = 'Allow to set a table background color' @@ -634,16 +652,17 @@ function Add-HtmlNodeTable { } } } else { + $IconSizeAttr = if ($IconWidth -and $IconHeight) { ' fixedsize="true" width="{0}" height="{1}"' -f $IconWidth, $IconHeight } else { '' } if ($MultiIcon) { while ($Number -ne $Group.Count) { if ($Icon.Count -gt 1) { foreach ($Element in $Group[$Number]) { - $TDICON += '' -f $Align, $Icon[$iconNumber] + $TDICON += '' -f $Align, $IconSizeAttr, $Icon[$iconNumber] $iconNumber++ } } else { foreach ($Element in $Group[$Number]) { - $TDICON += '' -f $Align, $Icon + $TDICON += '' -f $Align, $IconSizeAttr, $Icon } } $TR += '{0}' -f $TDICON @@ -708,7 +727,7 @@ function Add-HtmlNodeTable { } else { $TDICONMatch = if ($Icon.Count -eq 1) { $Icon } else { $Icon[0] } - $TDICON += '' -f $Align, $inputObject.Count, $TDICONMatch + $TDICON += '' -f $Align, $inputObject.Count, $IconSizeAttr, $TDICONMatch $TR += '{0}' -f $TDICON diff --git a/AsBuiltReport.Diagram/Src/Public/New-AbrDiagram.ps1 b/AsBuiltReport.Diagram/Src/Public/New-AbrDiagram.ps1 index 7d3cd9e..e1efb71 100644 --- a/AsBuiltReport.Diagram/Src/Public/New-AbrDiagram.ps1 +++ b/AsBuiltReport.Diagram/Src/Public/New-AbrDiagram.ps1 @@ -123,6 +123,9 @@ function New-AbrDiagram { .PARAMETER MainGraphAttributes Hashtable of graph attributes to override or augment defaults (examples: fontname, fontcolor, imagepath, style, nodesep, ranksep, bgcolor). + .PARAMETER Dpi + Raster output resolution in dots per inch for PNG/JPG formats (Ex: 300). Default: 96 (Graphviz default). + .PARAMETER WaterMarkColor Color used for watermark text. Default: 'DarkGray'. @@ -488,7 +491,14 @@ function New-AbrDiagram { HelpMessage = 'Set the image size in percent (100% is default)' )] [ValidateRange(1, 100)] - [int] $MainGraphLogoSizePercent = 100 + [int] $MainGraphLogoSizePercent = 100, + + [Parameter( + Mandatory = $false, + HelpMessage = 'Allow to set the raster output resolution in dots per inch (Ex: 300). Default: 96 (Graphviz default)' + )] + [ValidateRange(72, 600)] + [int] $Dpi ) begin { @@ -567,6 +577,10 @@ function New-AbrDiagram { if ($MainGraphSize) { $MainGraphAttributes['size'] = $MainGraphSize } + + if ($Dpi) { + $MainGraphAttributes['dpi'] = $Dpi + } } process { diff --git a/CHANGELOG.md b/CHANGELOG.md index c7917d3..85ac778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.8] - 2026-06-16 + +### :rocket: Added + +- Add `-Dpi` parameter to `New-AbrDiagram`, allowing the raster output resolution (PNG/JPG) to be set directly via the Graphviz `dpi` graph attribute instead of being fixed at the Graphviz default of 96 +- Add `-IconWidth`/`-IconHeight` parameters to `Add-HtmlNodeTable`, allowing the rendered icon size in a node's HTML table to be set explicitly instead of being derived solely from the source image's pixel dimensions + ## [1.0.7] - 2026-05-02 ### :arrows_clockwise: Changed