A step-by-step guidance for generating certificates using this package, customised for a specific athletics event.



1. Create your background image.

  • Start with CertificateTemplateBlank.png
    • It has a border which can be dispensed with.
    • It is 1024 x 1536 and 96 dpi
  • Paste your image into that keeping the image configuration
    • Overlay a logo if you wish in that context.
    • Save it giving it it a filename.
      • See CertificateTemplateFile below.

2. Adjust the main metadata in CertificateText.ps1.

  • In particular:
    • CertificateTemplateFile (Your background image file as above)
    • ParticipantSpreadsheetFile (The spreadsheet of results, more later.)
      • Suggest start with some dummy data.
    • SendUsingAccount (The Outlook account used for sending results)
      • See previous posts about setting this up.
    • CertificateTextColor (The RGB color of all certificate text)
      • An RGB tuple is a set of three numerical values representing the intensity of red, green, and blue in a color, each ranging from 0 to 255
#  Use CertificateTemplateBlank.png instead of the default CertificateTemplate.png 
#  ... if you want to create a new certificate for a new event and so add a new background image to that.
#
#$CertificateTemplateFile = "CertificateTemplateBlank.png"
$CertificateTemplateFile = "CertificateTemplate.png"

$ParticipantSpreadsheetFile = "results.xlsx"
$SendUsingAccount = "account@location.com.au"
$CertificateTextColor = @(0, 20, 90)
$CertificateSmoothingMode = "HighQuality"
$CertificateTextRenderingHint = "AntiAliasGridFit"

3. Adjust the Title, SubTitle, Host and Date (as below) other metadata in CertificateText.ps1.

$CertificateText = @(
    @{
        Name  = "Title"
        Text  = "1 HOUR TRACK RUN"
    }
    @{
        Name  = "SubTitle"
        Text  = "Moonee Valley Athletics Centre"
    }
    @{
        Name  = "Host"
        Text  = "Aberfeldie Masters Athletics"
    }
    @{
        Name  = "Date"
        Text  = "16 September 2026"
    }
)

4. Create some dummy data such as what is in results.xlsx

- Columns
  - No 
  - Name
  - Email
  - Distance
  - Time  

eg.

No Name Email Distance Time
1 Joe Blog fred@one.com.au DNS  
2 Julie Smith fred@one.com.au 8730 45:56
4 Fred Nurk fred@one.com.au 10145  
  • To generate distance only result leave time column blank for individuals
  • This could be used for throws and jumps events as well
  • For event with a fixed distance such as a Fun Run:
    • Change Distance heading to Time (see below) change the Time heading to something else.
    • Enter finish time/result for competitors in third column
    • Leave fourth column blank

5. Run the generate script/s with some data as above and check the generated certificates in Outlook Drafts folder

  • Before testing:* Make sure that the Outlook Drafts folder is targeted in the generator scripts:
          #$Mail.Send()
    
          # Save the email to the draft folder without sending it
          $Mail.Save()
    
  • Switch these when actually sending:
    • Uncomment $Mail.Send() and comment out $Mail.Save()
  • When generate script has been run, check for position of headings, labels and results wrt the background image

6. Adjust the positions of the certificate headings in CertificateText.ps1.

  • In part 3. vertical position was not shown. Eg for Title:
    @{
        Name  = "Title"
        Text  = "1 HOUR TRACK RUN"
        Font  = "Times New Roman"
        Size  = 77
        Style = "Bold"
        Y     = 70
    }

Text is centered so Y is its vertical position so adjust that for each of the four headings so that they are in a suitable location wrt the background image.

7. Further, in CertificateText.ps1 there is the entries

$LabelValueSize = 48
$ValueSizeDelta = 0

$FieldLabelSize = $LabelValueSize
$FieldValueSize = $LabelValueSize + $ValueSizeDelta
  • This sets the size of labels and associated data.
    • ValueSizeDelta of zero means both are of the same size.

8. Adjust the label and data in CertificateText.ps1

  • For example, you can change the text that is displayed for the "Distance" label (Note 1.) and its vertical position LabelY (Note 2.) - And you can change the associated result position ValueY. (Note 3.)
$CertificateFields = @{
    Standard = @(
      ...
      ...
        @{
            Name       = "Distance"
            Label      = "Distance" <-- Note 1.
            Suffix     = " metres"
            LabelFont  = "Arial"
            LabelSize  = $FieldLabelSize
            LabelStyle = "Bold"
            LabelY     = 1265       <-- Note 2.
            ValueFont  = "Arial"
            ValueSize  = $FieldValueSize
            ValueStyle = "Regular"
            ValueY     = 1380       <-- Note 3.
        }

😃


 TopicSubtopic
<  Prev:   Creating this site yet again
   
 This Category Links 
Category:Application Dev Index:Application Dev