Customizing Reports#
Tailor the user interface elements of your exported PDF reports. You have the flexibility to modify the font, customize the header and footer text, and provide a company logo according to your preferences. See the sample PDF image below for an illustration of these customizable features.
See also
Configuring the date format is done at runtime by using the --date-format
option. See date format for more information.
Setup#
When you first launch Patcher, a setup assistant will automatically create the necessary com.liquidzoo.patcher.plist
file in the user’s Library Application Support directory, located at $HOME/Library/Application Support/Patcher
. Once setup is completed successfully, the first_run_done
key in the property list file will automatically be set to True
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Setup</key>
<dict>
<key>first_run_done</key>
<true/>
</dict>
</dict>
</plist>
Warning
Do not modify the first_run_done
key in the Setup
dictionary directly. Altering this key may cause Patcher to re-run the setup process. If you need to reset the initial setup state, use the --reset
command instead. For more information, see resetting Patcher.
Modifying the Property List File#
The property list file contains the settings that control the appearance of the PDF reports. You can edit these values using /usr/libexec/PlistBuddy
or a code editor of your choice (VSCode, BBEdit, CodeRunner, etc.).
Opening Property Lists in Xcode
If the plist file appears as a binary file when opened in VSCode or other editors, you can open it in Xcode instead. Xcode is available as a free download from the Mac App Store and fully supports editing plist files. This will prevent issues with binary formatting that some editors may encounter.
Using jappleseed
as an example, the path to the property list file would be:
/Users/jappleseed/Library/Application Support/Patcher/com.liquidzoo.patcher.plist
Customizing the Font#
To change the font, update the FONT_NAME
, FONT_REGULAR_PATH
and FONT_BOLD_PATH
values in the UI dictionary.
$ /usr/libexec/PlistBuddy -c "Set :UI:FONT_NAME 'Helvetica'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
$ /usr/libexec/PlistBuddy -c "Set :UI:FONT_REGULAR_PATH '/path/to/Helvetica-Regular.ttf'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
$ /usr/libexec/PlistBuddy -c "Set :UI:FONT_BOLD_PATH '/path/to/Helvetica-Bold.ttf'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
Important
The default font used in testing is Google’s Assistant Font. While you can specify a different font to match your organization’s branding, be aware that doing so may cause formatting or alignment issues in the exported PDF reports. It is recommended to test the PDF export functionality thoroughly after changing the font to ensure the new font does not adversely affect the document’s appearance.
Adding a Company Logo#
Added in version 1.4.2
Patcher now allows you to include a company logo in your exported PDF reports. This can be helpful for ensuring unified branding for reports.
Supported Logo Requirements#
File Formats: The logo must be a valid image file in PNG, JPEG, or other Pillow-supported formats
File Validation: Patcher will validate the logo to ensure it is a valid image file before being added to the report.
See also
Need to make your own logo file? The macOS-icon-generator by SAP is a great (and free) resource for creating standardized app icons in PNG format.
Configuring a Logo#
To configure a branding logo for PDF reports after setup has completed, modify the property list by passing the logo file to the LOGO_PATH
key.
Open the property list file in Xcode or use PlistBuddy
to modify the property list file. (See Modifying the Property List File above). For demonstration purposes, PlistBuddy
will be used.
Tip
Absolute paths can be copied easily in macOS: Hold down the Option (⌥) symbol on the keyboard, right-click the logo file and select Copy <filename> as Pathname
Copy the path to your desired logo.
Execute the following command to add the logo file to the property list (replace
'/path/to/logo.png'
with the absolute path copied from step 1):
$ /usr/libexec/PlistBuddy -c "Set :UI:LOGO_PATH '/path/to/logo.png'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
While it is not required to copy the logo file to Patcher’s Application Support directory, it ensures the proper permissions are enabled to read the logo file.
Full Example Configuration#
Here is an example configuration with custom header, footer text, and a specified font:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Setup</key>
<dict>
<key>first_run_done</key>
<true/>
</dict>
<key>UI</key>
<dict>
<key>HEADER_TEXT</key>
<string>Confidential Report</string>
<key>FOOTER_TEXT</key>
<string>© 2024 Your Company</string>
<key>FONT_NAME</key>
<string>Helvetica</string>
<key>FONT_REGULAR_PATH</key>
<string>/path/to/Helvetica-Regular.ttf</string>
<key>FONT_BOLD_PATH</key>
<string>/path/to/Helvetica-Bold.ttf</string>
<key>LOGO_PATH</key>
<string>/Users/jappleseed/Library/Application Support/Patcher/logo.png</string>
</dict>
</dict>
</plist>
The above example would result in a PDF report that looks identical to the example PDF image at the top of this page.