4

want to test the upload file size limit in an application, and it's a pain finding / making various pdf's of certain sizes to test / debug this. Anybody have a better way?

Garrett Simpson
  • 1,471
  • 2
  • 17
  • 18

2 Answers2

2

You can write a simple shell script that converts set of images to pdf: How can I convert a series of images to a PDF from the command line on linux? and do it for 1,2,3, ..., all image files in certain directory.

Creating directory full of copies of single image, should be simple too, start with one image file with desired size e.g. 64KB.

# pseudocode - don't test it
END=5
for i in {1..$END}; do cp ./image ./image_$i; done
for i in {1..$END}; do convert ./image_{1..$i} mydoc_$i.pdf; done
Community
  • 1
  • 1
csharpfolk
  • 4,124
  • 25
  • 31
-3

I've found an online tool, however, it seems to not be working correctly since it can only generate 10MB files even though you tell it to make a 50MB file.

https://www.fakefilegenerator.com/generate-file.php

  • 2
    this page generates not real files of the selected type. It is just a random files and adds the selected file type. eg pdf cant be opened in a pdf reader because it is just binary crap (also, mime not available) – MilMike Aug 20 '21 at 08:31