Here is how I did it. Step 1. I wrote a simple script, which prepares a text file to be converted to PDF:
#!/bin/bash
echo "" > testContent.txt
for i in {1..5000}
do
echo "Test content to fill into large pdf." >> testContent.txt
done;
cupsfilter testContent.txt > large0.pdf 2>/dev/null
Note that you should be able to adjust amount of text you would like to see in the file, and the text itself, so the content looks exactly how you want to see it. The final large0.pdf if the test PDF file, which you need. cupsfilter command (http://linux.die.net/man/8/cupsfilter) actually converts text file into another format, by default into PDF.
You can read more about cupsfilter by reading cupsfilter connmmand syntax description on developer.apple.com
I will show in next article, how from a single PDF file you can create a set of files of multiple sizes.
No comments:
Post a Comment