Skip to content

x2pdf command adds images to pdf in the wrong order #241

@colord

Description

@colord

I ran this command:
uvx pdfly x2pdf *.jpeg -o output.pdf

The pdfly x2pdf command will convert a folder of images (organized like 0001.jpeg, 0002.jpeg, 0003.jpeg, etc.) into a pdf that is backwards where the 3rd jpeg is the 1st page in the pdf.

I think it's because this line will add the new_page at index 0 for every filepath and it ends up prepending instead of appending:

writer.insert_page(new_page)

Environment

  • Operating System: Fedora Linux 43
  • Python version: 3.13.11
  • pdfly version used: 0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions