Skip to content
New issue

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

Add PDFImage with PDFAttributedText .left, .center, .right #356

Open
AlexLojewski opened this issue Dec 15, 2023 · 1 comment
Open

Add PDFImage with PDFAttributedText .left, .center, .right #356

AlexLojewski opened this issue Dec 15, 2023 · 1 comment
Labels

Comments

@AlexLojewski
Copy link

AlexLojewski commented Dec 15, 2023

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.

Bildschirmfoto 2023-12-15 um 12 20 47

TPPDF Environment

TPPDF version: 2.4.1
Xcode version: Version 15.1 (15C65)
Swift version: 5.9

@philprime
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants