Skip to content

feat(working-with-headers-and-footers): add 30 compiler-validated C# examples - Working With Headers And Footers [26.8.0/net8.0] - #91

Merged
amjad-sahi merged 37 commits into
mainfrom
feat/examples-working-with-headers-and-footers-20260828
Aug 28, 2026
Merged

feat(working-with-headers-and-footers): add 30 compiler-validated C# examples - Working With Headers And Footers [26.8.0/net8.0]#91
amjad-sahi merged 37 commits into
mainfrom
feat/examples-working-with-headers-and-footers-20260828

Conversation

@agent-aspose-diagram-examples

Copy link
Copy Markdown
Collaborator

Working With Headers And Footers — Compiler-Validated C# Examples

What this PR does

Adds 30 AI-generated, compiler-validated C# examples for the Working With Headers And Footers category of Aspose.Diagram for .NET.

All examples were generated by the Aspose.Diagram Examples Generator Agent and passed the full three-attempt validation pipeline before being included.

Validation Summary

Check Result
dotnet build ✅ Passed — zero compiler errors
dotnet run ✅ Passed — clean execution
Aspose.Diagram Version 26.8.0
Target Framework net8.0
Examples Added 30

Pipeline

Each example was generated and validated through:

  1. Attempt 1 — MCP direct code retrieval and assembly
  2. Attempt 2 — MCP retrieval with injected API correction rules
  3. Attempt 3 — LLM repair pass with compiler errors and rules

Only examples that passed both dotnet build and dotnet run are included in this PR.

Examples Added

File Task Description
adjust-the-footer-margin-dynamically-based-on-the-number-of-shapes-on-the-page-to-avoid-overlap.cs Adjust the footer margin dynamically based on the number of shapes on the page to avoid overlap
apply-a-uniform-header-margin-of-0-25-inches-to-all-diagrams-in-a-batch-and-log-failures.cs Apply a uniform header margin of 0 25 inches to all diagrams in a batch and log failures
apply-identical-header-and-footer-font-settings-across-all-diagrams-in-a-specified-folder-using-batch-processing.cs Apply identical header and footer font settings across all diagrams in a specified folder using batch processing
apply-italic-style-to-the-right-footer-text-only-when-the-document-contains-more-than-ten-pages.cs Apply italic style to the right footer text only when the document contains more than ten pages
assign-a-new-string-to-the-right-footer-text-and-save-the-diagram-as-a-vdx-file.cs Assign a new string to the right footer text and save the diagram as a vdx file
automate-the-process-of-adding-a-page-number-placeholder-to-the-right-footer-of-each-diagram-in-a-collection.cs Automate the process of adding a page number placeholder to the right footer of each diagram in a collection
compare-left-header-text-between-two-diagrams-and-output-the-differences-to-a-log-file.cs Compare left header text between two diagrams and output the differences to a log file
configure-the-footer-margin-to-0-3-centimeters-and-verify-the-change-using-print-preview.cs Configure the footer margin to 0 3 centimeters and verify the change using print preview
create-a-command-line-tool-that-accepts-a-directory-path-and-applies-a-predefined-header-footer-template-to-all-visio-fi.cs Create a command line tool that accepts a directory path and applies a predefined header footer template to all visio fi
create-a-script-that-reads-header-and-footer-configurations-from-an-xml-file-and-applies-them-to-a-diagram.cs Create a script that reads header and footer configurations from an xml file and applies them to a diagram
create-a-utility-method-that-accepts-a-diagram-path-and-header-settings-applies-them-and-saves-the-file.cs Create a utility method that accepts a diagram path and header settings applies them and saves the file
define-header-font-name-as-arial-size-10-points-and-apply-bold-style-to-the-left-header.cs Define header font name as arial size 10 points and apply bold style to the left header
ensure-that-after-modifying-header-text-the-diagram-s-print-preview-reflects-the-updated-content-accurately.cs Ensure that after modifying header text the diagram s print preview reflects the updated content accurately
extract-current-header-and-footer-text-values-from-a-diagram-and-write-them-to-a-json-configuration-file.cs Extract current header and footer text values from a diagram and write them to a json configuration file
generate-a-report-listing-each-diagram-s-left-center-and-right-header-texts-after-batch-modifications.cs Generate a report listing each diagram s left center and right header texts after batch modifications
generate-a-summary-csv-file-listing-each-diagram-s-file-name-header-margins-and-footer-font-sizes-after-processing.cs Generate a summary csv file listing each diagram s file name header margins and footer font sizes after processing
implement-a-function-to-copy-header-and-footer-settings-from-one-diagram-to-another-without-altering-page-content.cs Implement a function to copy header and footer settings from one diagram to another without altering page content
load-a-diagram-clear-all-existing-footer-texts-then-assign-a-standardized-disclaimer-to-each-footer-region.cs Load a diagram clear all existing footer texts then assign a standardized disclaimer to each footer region
load-a-visio-file-into-a-diagram-object-and-retrieve-the-left-header-text-value.cs Load a visio file into a diagram object and retrieve the left header text value
load-multiple-visio-files-set-left-header-text-to-document-title-and-save-each-file-with-updated-headers.cs Load multiple visio files set left header text to document title and save each file with updated headers
read-the-center-header-text-replace-any-occurrence-of-the-word-draft-with-final-and-save-changes.cs Read the center header text replace any occurrence of the word draft with final and save changes
retrieve-current-footer-margin-value-from-a-diagram-and-log-it-to-the-console-for-debugging.cs Retrieve current footer margin value from a diagram and log it to the console for debugging
retrieve-the-current-header-font-style-change-it-to-italic-and-verify-the-change-by-reading-back-the-property.cs Retrieve the current header font style change it to italic and verify the change by reading back the property
set-footer-font-to-times-new-roman-size-9-points-italic-style-for-the-center-footer-text.cs Set footer font to times new roman size 9 points italic style for the center footer text
set-header-font-style-to-bold-and-underline-for-the-center-header-preserving-existing-font-name-and-size.cs Set header font style to bold and underline for the center header preserving existing font name and size
set-header-margin-based-on-page-size-0-2-inches-for-a4-and-0-3-inches-for-letter-formats.cs Set header margin based on page size 0 2 inches for a4 and 0 3 inches for letter formats
set-the-header-margin-to-0-5-inches-for-a-diagram-before-exporting-to-pdf-format.cs Set the header margin to 0 5 inches for a diagram before exporting to pdf format
update-the-center-header-text-of-a-loaded-diagram-with-a-custom-company-name-string.cs Update the center header text of a loaded diagram with a custom company name string
use-conditional-logic-to-set-different-footer-fonts-for-diagrams-based-on-their-file-extensions-vsdx-vs-vdx.cs Use conditional logic to set different footer fonts for diagrams based on their file extensions vsdx vs vdx
validate-that-the-right-footer-text-matches-a-predefined-pattern-after-modification-and-raise-an-exception-if-not.cs Validate that the right footer text matches a predefined pattern after modification and raise an exception if not

Validation Details


This PR was created automatically by the Aspose.Diagram Examples Generator Agent. Merge after reviewing the examples above.

…dynamically-based-on-the-number-of-shapes-on-the-page-to-avoid-overlap

Task: Adjust the footer margin dynamically based on the number of shapes on the page to avoid overlap

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…rgin-of-0-25-inches-to-all-diagrams-in-a-batch-and-log-failures

Task: Apply a uniform header margin of 0 25 inches to all diagrams in a batch and log failures

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…d-footer-font-settings-across-all-diagrams-in-a-specified-folder-using-batch-processing

Task: Apply identical header and footer font settings across all diagrams in a specified folder using batch processing

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…-right-footer-text-only-when-the-document-contains-more-than-ten-pages

Task: Apply italic style to the right footer text only when the document contains more than ten pages

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…e-right-footer-text-and-save-the-diagram-as-a-vdx-file

Task: Assign a new string to the right footer text and save the diagram as a vdx file

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…dding-a-page-number-placeholder-to-the-right-footer-of-each-diagram-in-a-collection

Task: Automate the process of adding a page number placeholder to the right footer of each diagram in a collection

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…between-two-diagrams-and-output-the-differences-to-a-log-file

Task: Compare left header text between two diagrams and output the differences to a log file

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…in-to-0-3-centimeters-and-verify-the-change-using-print-preview

Task: Configure the footer margin to 0 3 centimeters and verify the change using print preview

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…l-that-accepts-a-directory-path-and-applies-a-predefined-header-footer-template-to-all-visio-fi

Task: Create a command line tool that accepts a directory path and applies a predefined header footer template to all visio fi

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…s-header-and-footer-configurations-from-an-xml-file-and-applies-them-to-a-diagram

Task: Create a script that reads header and footer configurations from an xml file and applies them to a diagram

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…hat-accepts-a-diagram-path-and-header-settings-applies-them-and-saves-the-file

Task: Create a utility method that accepts a diagram path and header settings applies them and saves the file

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…s-arial-size-10-points-and-apply-bold-style-to-the-left-header

Task: Define header font name as arial size 10 points and apply bold style to the left header

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…ng-header-text-the-diagram-s-print-preview-reflects-the-updated-content-accurately

Task: Ensure that after modifying header text the diagram s print preview reflects the updated content accurately

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…d-footer-text-values-from-a-diagram-and-write-them-to-a-json-configuration-file

Task: Extract current header and footer text values from a diagram and write them to a json configuration file

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…-each-diagram-s-left-center-and-right-header-texts-after-batch-modifications

Task: Generate a report listing each diagram s left center and right header texts after batch modifications

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…le-listing-each-diagram-s-file-name-header-margins-and-footer-font-sizes-after-processing

Task: Generate a summary csv file listing each diagram s file name header margins and footer font sizes after processing

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…opy-header-and-footer-settings-from-one-diagram-to-another-without-altering-page-content

Task: Implement a function to copy header and footer settings from one diagram to another without altering page content

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…existing-footer-texts-then-assign-a-standardized-disclaimer-to-each-footer-region

Task: Load a diagram clear all existing footer texts then assign a standardized disclaimer to each footer region

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…diagram-object-and-retrieve-the-left-header-text-value

Task: Load a visio file into a diagram object and retrieve the left header text value

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…-set-left-header-text-to-document-title-and-save-each-file-with-updated-headers

Task: Load multiple visio files set left header text to document title and save each file with updated headers

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…xt-replace-any-occurrence-of-the-word-draft-with-final-and-save-changes

Task: Read the center header text replace any occurrence of the word draft with final and save changes

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…argin-value-from-a-diagram-and-log-it-to-the-console-for-debugging

Task: Retrieve current footer margin value from a diagram and log it to the console for debugging

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…er-font-style-change-it-to-italic-and-verify-the-change-by-reading-back-the-property

Task: Retrieve the current header font style change it to italic and verify the change by reading back the property

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…new-roman-size-9-points-italic-style-for-the-center-footer-text

Task: Set footer font to times new roman size 9 points italic style for the center footer text

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…bold-and-underline-for-the-center-header-preserving-existing-font-name-and-size

Task: Set header font style to bold and underline for the center header preserving existing font name and size

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…n-page-size-0-2-inches-for-a4-and-0-3-inches-for-letter-formats

Task: Set header margin based on page size 0 2 inches for a4 and 0 3 inches for letter formats

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…0-5-inches-for-a-diagram-before-exporting-to-pdf-format

Task: Set the header margin to 0 5 inches for a diagram before exporting to pdf format

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…text-of-a-loaded-diagram-with-a-custom-company-name-string

Task: Update the center header text of a loaded diagram with a custom company name string

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…set-different-footer-fonts-for-diagrams-based-on-their-file-extensions-vsdx-vs-vdx

Task: Use conditional logic to set different footer fonts for diagrams based on their file extensions vsdx vs vdx

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
…ooter-text-matches-a-predefined-pattern-after-modification-and-raise-an-exception-if-not

Task: Validate that the right footer text matches a predefined pattern after modification and raise an exception if not

- Validated: dotnet build passed
- Validated: dotnet run passed
- Generator: Aspose.Diagram Examples Generator Agent v2.0
- Library: Aspose.Diagram for .NET 26.8.0
- Framework: net8.0
- Pipeline: MCP retrieval → rules injection → LLM repair
@amjad-sahi
amjad-sahi merged commit 0104ba3 into main Aug 28, 2026
1 check passed
@amjad-sahi
amjad-sahi deleted the feat/examples-working-with-headers-and-footers-20260828 branch August 28, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants