Skip to content

Image in Paragraph has unexpected behavior #687

Description

@ObsisMc

Describe the bug
Add a string and an image into a Paragraph, the string will overlap with the image.

To Reproduce

        Document document = new Document(PageSize.A4);
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("myTest.pdf"));

        Image jpg = Image.getInstance("qv2ray.32.png");
        String test = "test";
        Paragraph paragraph = new Paragraph();
        paragraph.add(test);
        paragraph.add(jpg);

        document.open();
        document.add(paragraph);
        document.close();

The image can be any image.

Expected behavior
I think maybe they the image should be behind the string.

Actual behavior
图片

System (please complete the following information):

  • OS: Ubuntu20.04

Additional context
I am not sure whether it is a bug or maybe I can use other methods to get expected behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions