diff --git a/paperless.go b/paperless.go index ec2ecb4..b477324 100644 --- a/paperless.go +++ b/paperless.go @@ -11,6 +11,7 @@ import ( "net/http" "os" "path/filepath" + "slices" "strings" "sync" @@ -411,6 +412,9 @@ func (c *PaperlessClient) DownloadDocumentAsImages(ctx context.Context, document return nil, err } + // sort the image paths to ensure they are in order + slices.Sort(imagePaths) + return imagePaths, nil }