### Install PSWritePDF Module Source: https://github.com/evotecit/pswritepdf/blob/master/Website/content/project-docs/docs/install.md Installs the PSWritePDF module for the current user from the PowerShell Gallery. This is the recommended method for a quick setup. ```powershell Install-Module PSWritePDF -Scope CurrentUser ``` -------------------------------- ### Install PSWritePDF Module Source: https://github.com/evotecit/pswritepdf/blob/master/README.md Installs or updates the PSWritePDF module from the PowerShell Gallery. Use -Force to overwrite existing versions. ```powershell Install-Module PSWritePDF -Force ``` -------------------------------- ### Create a Simple PDF Document Source: https://github.com/evotecit/pswritepdf/blob/master/Website/content/examples/create-simple-pdf.md This snippet demonstrates creating a PDF with text and list elements. It requires importing the PSWritePDF module and uses the New-PDF cmdlet to define the document structure and output file. ```powershell Import-Module .\PSWritePDF.psd1 -Force New-PDF { New-PDFText -Text 'Hello ', 'World' -Font HELVETICA, TIMES_ITALIC -FontColor GRAY, BLUE New-PDFText -Text 'Generated from PowerShell.' -Font HELVETICA -FontColor RED New-PDFList -Indent 3 { New-PDFListItem -Text 'First item' New-PDFListItem -Text 'Second item' } } -FilePath "$PSScriptRoot\Example01_Simple.pdf" -Show ``` -------------------------------- ### Standard AGPL v3.0 Copyright Notice Source: https://github.com/evotecit/pswritepdf/blob/master/Ignore/itext7.font-asian.7.1.8/gnu-agpl-v3.0.md Include this notice at the beginning of each source file to state the exclusion of warranty and point to the full license. Ensure the copyright line and a pointer to the full notice are present. ```text Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . ``` -------------------------------- ### Merge PDF Files Source: https://github.com/evotecit/pswritepdf/blob/master/Website/content/examples/merge-pdf-files.md This snippet demonstrates how to merge multiple PDF files into a single output file using the Merge-PDF cmdlet. Ensure the PSWritePDF module is imported before execution. Specify input files as an array and provide a deterministic output path. ```powershell Import-Module .\PSWritePDF.psd1 -Force $inputFiles = @( "$PSScriptRoot\Input\OutputDocument0.pdf" "$PSScriptRoot\Input\OutputDocument1.pdf" ) $outputFile = "$PSScriptRoot\Output\OutputDocument.pdf" Merge-PDF -InputFile $inputFiles -OutputFile $outputFile -Verbose ``` -------------------------------- ### Initialize DataTable with HTML to PDF Export Options Source: https://github.com/evotecit/pswritepdf/blob/master/Example/Example10.ConvertFromHTML/Example10-FromFilePath.html This snippet initializes a DataTables instance with various export buttons, including Copy, Excel, CSV, and PDF. It configures the PDF export to use A3 page size and landscape orientation. It also includes custom formatting for Excel export to handle numeric data correctly. ```javascript $(document).ready(function() { $.fn.dataTable.moment( 'L' ); // Table code var table = $('#DT-mjyXdEqM').DataTable( { "dom":"ABfrtip", "searchFade":false, "scrollCollapse":false, "ordering":true, "order":[], "rowGroup":"", "info":true, "procesing":true, "select":true, "searching":true, "stateSave":true, "paging":true, "pagingType":["full_numbers"], "lengthMenu":[[15,25,50,100,-1],[15,25,50,100,"All"]], "language":{ }, "buttons":[ { "extend":"copyHtml5"}, { "extend":"excelHtml5", "exportOptions":{ "format": { body: function (data, row, column, node) { data = $('

' + data + '

').text(); return $.isNumeric(data.replace(',', '.')) ? data.replace(',', '.') : data; } }}}, { "extend":"csvHtml5"}, { "extend":"pdfHtml5", "pageSize":"A3", "orientation":"landscape"}, { "extend":"pageLength"}, { "extend":"searchBuilder", "config":{ }} ], "responsive":{ "details":{ "type":"inline"}} } ); }); ``` -------------------------------- ### Register Custom Fonts with PSWritePDF Source: https://github.com/evotecit/pswritepdf/blob/master/CHANGELOG.MD Use Register-PDFFont to add custom fonts, enabling support for Unicode characters not present in built-in fonts. The -Default switch makes it the default font for subsequent operations. ```powershell Register-PDFFont -FontName 'Verdana' -FontPath 'C:\Windows\fonts\verdana.ttf' -Encoding IDENTITY_H -Cached -Default ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.