Add PDFImage with PDFAttributedText .left, .center, .right
AlexLojewski opened this issue · 1 comments
AlexLojewski commented
What did you do?
document.add(.contentLeft, image: PDFImage(
image: CameraImageManager.loadImageFromDiskWith(
fileName: damageReport.imageName
)!,
caption: PDFAttributedText(text: NSAttributedString(
string: damageReport.descriptionText,
attributes: nil
)),
size: CGSize(width: 200, height: 165),
quality: 0.85,
options: .none,
cornerRadius: .none
))
What did you expect to happen?
The image is on the left and the specified text is either on the left under the image or centered under the image
What happened instead?
The image is on the left and the text is centered on the page.
TPPDF Environment
TPPDF version: 2.4.1
Xcode version: Version 15.1 (15C65)
Swift version: 5.9
philprime commented
Hi, thanks for opening up the issue.
The text being in the center of the document is indeed unexpected.
Could you please create a minimal full PDFDocument
with an example image that produces the error? It's way easier for me to debug if I can run it on my machine.
You can use the Examples.xcworkspace
together with the ExperimentFactory.swift
to set it up