Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Bug - PDF Splitting File Size

Open lawfulsoftware opened this issue 1 year ago • 5 comments

I split a test 11-page PDF file with a file size of 545 KB using the split-pages API endpoint with a pageNumbers value of 1n.

The output is 11 PDF files in a ZIP file however the total size of the ZIP file is 5,399 KB and the uncompressed size of each PDF file is between 516 KB and 519 KB which is nearly the size of the entire original file.

I am using the latest alpha Docker container.

lawfulsoftware avatar Oct 03 '23 21:10 lawfulsoftware

Just added a quick fix, can you try pull the latest alpha version and see if that has better results

Frooodle avatar Oct 03 '23 21:10 Frooodle

You work quickly! No change unfortunately.

lawfulsoftware avatar Oct 03 '23 23:10 lawfulsoftware

One further issue. Please let me know if you want me to put this in a separate thread.

When I access the split-pages endpoint with n8n, it downloads the file as split-pages.bin instead of test.zip. These are the headers from n8n.

content-disposition:form-data; name="attachment"; filename="test.zip" content-type:application/octet-stream content-length:5529539 date:Tue, 03 Oct 2023 23:46:35 GMT connection:close

If I rename split-pages.bin to split-pages.zip, it is a working ZIP file. I note that the Swagger UI returns a URI of blob:http://{{IP}}:{{PORT}}/UUID

Is it possible to revise the output to provide a content-type or content-disposition that n8n can interpret as a ZIP file?

lawfulsoftware avatar Oct 04 '23 00:10 lawfulsoftware

An additional feature request for this module. Is it possible to return the number of PDF files contained within the ZIP file?

lawfulsoftware avatar Oct 04 '23 01:10 lawfulsoftware

Also, an option to output an array of individual files would be beneficial as it is a PITA to have to programmatically process a ZIP file in n8n.

lawfulsoftware avatar Oct 04 '23 03:10 lawfulsoftware

closing and duplicate of 401 really

Frooodle avatar Apr 28 '24 22:04 Frooodle