We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like the title of my pdf to be a larger font - is there any way to achieve this?
The text was updated successfully, but these errors were encountered:
I figured it out. You must use NSAttributedString, as below for example:
let A4paperSize = CGSize(width: 595, height: 842) let pdf = SimplePDF(pageSize: A4paperSize, pageMargin: 20.0) pdf.setContentAlignment(.center) pdf.addImage(UIImage(named: "bizzybooksbee")!) let titleIncomeStatement = String(selectedYear) + " Income Statement" let font = UIFont.systemFont(ofSize: 36) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center let titleAttributes: [NSAttributedStringKey: Any] = [ .font: font, .paragraphStyle: paragraphStyle ] let attributedTitleIncomeStatement = NSAttributedString(string: titleIncomeStatement, attributes: titleAttributes) pdf.addAttributedText(attributedTitleIncomeStatement) pdf.addText("Created with Bizzy Books") pdf.addLineSeparator() pdf.setContentAlignment(.left) pdf.addText("Income: " + String(income))
Sorry, something went wrong.
No branches or pull requests
I'd like the title of my pdf to be a larger font - is there any way to achieve this?
The text was updated successfully, but these errors were encountered: