EvotecIT / PSWritePDF

PowerShell Module to create, edit, split, merge PDF files on Windows / Linux and MacOS
GNU Affero General Public License v3.0
195 stars 21 forks source link

Formatting a table to fix text to sheet. #28

Open rduncanpph opened 3 years ago

rduncanpph commented 3 years ago

Hello,

I have a New-PDFTable where one of the columns has a large amount of text that makes the table expand past the margins and onto another page. Is there way to format tables so that text is smaller and the columns don't exceed the margins?

Thank you

Example

$NewEmployeeInquiriesTable = @(
                    [pscustomobject]@{Completed = (Get-UDElement -Id 'NewEmployeeInquiriesCheckbox1').checked;Task = "Inquire with the new hire’s manager to determine:``n● Where the new hire will be seated.`n● What software packages the new hire will require.`n● If the new hire is an engineer, inquire if they should be given a general-purpose laptop or an engineering laptop for design work requiring enhanced graphics processing. `n● If ERP account(s) are required, create linked request(s) for each ERP access for the ERP technician to configure for the particular RBAC role and provide login information. [Article]`n● If offsite/VPN access will be required. If you do not have access to create a VPN account, create a linked request for an infrastructure technician."}                 
                )

New-PDFTable -DataTable $NewEmployeeInquiriesTable
PrzemyslawKlys commented 3 years ago

I don't think it's implemented. Probably needs work based on this C# code: https://kb.itextpdf.com/home/it7kb/examples/fit-text-in-cell

Not fun :-)